EzDevInfo.com

grid interview questions

Top grid frequently asked interview questions

Meaning of * (asterisk) in a WPF ColumnDefinition? (weighted proportion of available space)

What is the meaning of * (asterisk) in the XAML below?

 <ColumnDefinition Width="0.07*"/>
<Grid Height="100" HorizontalAlignment="Left" 
          Margin="102,134,0,0" 
          Name="grid1" VerticalAlignment="Top" 
          Width="354">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="40*" />
            <ColumnDefinition Width="314*" />
        </Grid.ColumnDefinitions>
    </Grid>

Source: (StackOverflow)

WPF: Grid with column/row margin/padding?

Is it easily possible to specify a margin and/or padding for rows or columns in a WPF Grid?

I could of course add extra columns to space things out, but this seems like a job for padding/margins (it will give much simplier XAML). Has someone derived from the standard Grid to add this functionality?


Source: (StackOverflow)

Advertisements

Resize jqGrid when browser is resized?

Is there any way to resize a jqGrid when the browser window is resized? I have tried the method described here but that technique does not work in IE7.


Source: (StackOverflow)

What does the WPF star do (Width="100*")

What does exactly the star in size terms in WPF mean?


Source: (StackOverflow)

grid controls for ASP.NET MVC? [closed]

If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere?

These are some of the known grid display solutions I have found for ASP.NET MVC

If you know of anything else that you are using or know to be good, please let me know.


Source: (StackOverflow)

Meaning of numbers in col-md-4 , col-xs-1 , col-lg-2 in bootstrap

I am confused with the grid system in the new bootstrap, particularly these classes:

col-lg-*
col-md-*
col-xs-*

(where * represents some number)

can anyone please explain how that number is aligning the grids, and how to use these numbers, and what they actually represent


Source: (StackOverflow)

GridView VS GridLayout in Android Apps

I have to use a grid to implement Photo Browser in Android, and I want to know the difference between GridView and GridLayout.

I'm using GridView to display the images dynamically (from SD card).


Source: (StackOverflow)

How to validate inputs dynamically created using ng-repeat, ng-show (angular)

I have a table that is created using ng-reapeat. I want to add validation to each element in the table. The problem is that each input cell has the same name as the cell above and below it. I attempted to use the {{$index}} value to name the inputs, but despite the string literals in HTML appearing correct, it is now working.

Here is my code as of now:

<td>
    <input ng-model="r.QTY" class="span1" name="QTY{{$index}}" ng-pattern="/^[\d]*\.?[\d]*$/" required/>
    <span class="alert-error" ng-show="form.QTY{{$index}}.$error.pattern"><strong>Requires a number.</strong></span>
    <span class="alert-error" ng-show="form.QTY{{$index}}.$error.required"><strong>*Required</strong></span>
</td>

I have tried removing the `{{}}' from index, but that does not work either. As of now, the validation property of the input is working correctly, but the error message is not displayed.

Anyone have any suggestions?

Edit: In addition to the great answers below, here is a blog article that covers this issue in more detail: http://www.thebhwgroup.com/blog/2014/08/angularjs-html-form-design-part-2/


Source: (StackOverflow)

Best dynamic JavaScript/JQuery Grid [closed]

I'm working with JavaScript, JQuery and HTML. UI Of my project is completely dynamic. I am looking for a dynamic JavaScript/JQuery Grid which supports following features.

Can anybody tell me is there any good looking open sources Grid which supports the following features?

  1. I should be able to create an instance of the grid at run-time and add to DOM.
  2. Supports column templates (textbox, select, checkbox or any inputs or simple text)
  3. Supports set new column template or replace existing column template at real-time.
  4. Few input control (e.g textbox, checkbox..) present under a column may be enabled and few may be disabled.
  5. Supports setData() at real-time.
  6. Supports event if any input data changed by user.
  7. It should support selection of a Row
  8. Add row or delete row support at real-time without rendering the whole grid.
  9. Supports Paging.
  10. Supports sorting by any column at real-time.
  11. Fires an event if data is sorted by user at real-time.
  12. Grid UI must support realizable columns
  13. Auto re-sizable (It will be great if grid is auto re-sizable according to the size of the parent element)
  14. Definitely has good documentation.

Source: (StackOverflow)

Mosaic Grid gallery with dynamic sized images [closed]

I have just received the following design for a project, for an image grid gallery, with dynamic width & height images (user submitted images). (Screenshot at the end of post)

I have tried jQuery Masonry, Tympanus Automatic Image Montage and CSS-Tricks Seemless Responsive Photo Grid, but each has their limitation.

  • Jquery Masonry allows for both width and height to be dynamic, however there are gaps generated
  • The latter 2 scripts, generate very nice grids, but with the problem that either width or height must be static

EDIT: i came across, Isotope, which is almost perfect and i will probably end up using it, unless there's something that fixes my needs exactly. Therefore my question still remains the same...

Is there any javascript (preferably jQuery) script that can generate a completely dynamic mosaic (in respect to image size), like the one in the screenshot below?

Thanks for any help


Gallery


Source: (StackOverflow)

WPF: Hide grid row

I have a simple WPF form with a <Grid> declared on the Form.

In this Grid I then have a bunch of Rows:

   <Grid.RowDefinitions>
        <RowDefinition Height="Auto" MinHeight="30" />
        <RowDefinition Height="Auto" Name="rowToHide"/>
        <RowDefinition Height="Auto" MinHeight="30" />
    </Grid.RowDefinitions>

So basically the row with the name "rowToHide" has a few input fields in it, and now I want to hide this row as I don't need these fields. Its simple enough to just set all items in the Row to Visibility = Hidden, but the Row still takes up space in the Grid. So need to do something like setting Height = 0 or something. But that didn't seem to work.

You can think of it like this: You have a form, in there we have a drop down saying "Payment Type", and if the person selects "Cash", then hide the row containing the Card details. And it isn't an option to start the form with this hidden already.

Thanks everyone!


Source: (StackOverflow)

jQuery Spreadsheet/Grid plugin with copy/paste from/to Excel [closed]

I am looking for a jQuery plugin for something like spreadsheet or grid. I have found a lot of jQuery Grid plugins and one spreadsheet plugin. But I would like functionality with copy/paste cells from/to Excel. Something like here Any suggestions?


Source: (StackOverflow)

How to populate a WPF grid based on a 2-dimensional array

I have a 2-dimensional array of objects and I basically want to databind each one to a cell in a WPF grid. Currently I have this working but I am doing most of it procedurally. I create the correct number of row and column definitions, then I loop through the cells and create the controls and set up the correct bindings for each one.

At a minimum I would like to be able to use a template to specify the controls and bindings in xaml. Ideally I would like to get rid of the procedural code and just do it all with databinding, but I'm not sure that's possible.

Here is the code I am currently using:

public void BindGrid()
{
    m_Grid.Children.Clear();
    m_Grid.ColumnDefinitions.Clear();
    m_Grid.RowDefinitions.Clear();

    for (int x = 0; x < MefGrid.Width; x++)
    {
        m_Grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star), });
    }

    for (int y = 0; y < MefGrid.Height; y++)
    {
        m_Grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star), });
    }

    for (int x = 0; x < MefGrid.Width; x++)
    {
        for (int y = 0; y < MefGrid.Height; y++)
        {
            Cell cell = (Cell)MefGrid[x, y];                    

            SolidColorBrush brush = new SolidColorBrush();

            var binding = new Binding("On");
            binding.Converter = new BoolColorConverter();
            binding.Mode = BindingMode.OneWay;

            BindingOperations.SetBinding(brush, SolidColorBrush.ColorProperty, binding);

            var rect = new Rectangle();
            rect.DataContext = cell;
            rect.Fill = brush;
            rect.SetValue(Grid.RowProperty, y);
            rect.SetValue(Grid.ColumnProperty, x);
            m_Grid.Children.Add(rect);
        }
    }

}

Source: (StackOverflow)

Nested rows with bootstrap grid system?

I want 1 larger image with 4 smaller images in a 2x2 format like this:

Figure 1 Example

My initial thought was to house everything in one row. Then create two columns, and, in the second column, create two rows and two columns to create the 1x1 and 2x2 effect.

However, this doesn't seem to be possible, or I am just not doing it correctly?


Source: (StackOverflow)