This is a migrated thread and some comments may be shown as answers.

Row questions

6 Answers 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 01 Mar 2011, 02:34 PM
1. Is there a way where I can get a blank row/space between rows. That way the grid will look neater.
2. Is there a property or method which prevents a row being part of the filter.
3. Is there a property or method by which I can pin a row to the top so that it does not go off the view while scrolling vertically.


Thanks
Deepak

6 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 01 Mar 2011, 02:42 PM
Hi Deepak,

Hope you're well.

1: You can set row space in the radGridview using the following example
this.radGridView1.TableElement.RowSpacing = 10;

2: In order to exclude certain rows from a filter, you would need to implement a custom filter. Please have a look at the help topic on custom filtering or the demos on your PC for more information.

3: Yes, you can pin rows in RadGridView. Again, please have a look at the help topic on pinning rows

If you need more information, please just let me know
Richard
0
Deepak
Top achievements
Rank 1
answered on 01 Mar 2011, 03:18 PM
Hi Richard,
 I am doing good. thanks. Hope you are doing good too...The rowspacing does not work if there is a custom viewdefinition.
I do not need to set the custom filter because if a row is pinned, it does not get filtered. The row that I needed pinned and the row that bypasses filter are the same for me...

Thanks
Deepak
0
Richard Slade
Top achievements
Rank 2
answered on 01 Mar 2011, 03:28 PM
Hi Deepak,

I don't know if a workaround currently for the row spacing using a ViewDefinition but there will be a new release out in the middle of the month. Perhaps this might be in that.

Ok, so we have solved two issues by just pinning the row (I wasn't aware that the row you didn't want filtered was the pinned row).
Please remember to mark as answer if this helped you and let me know if you have any other questions
Richard
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 01 Mar 2011, 03:52 PM
Hi Deepak,

I've just tried the row spacing with a view definition and it does actually work fine it seems. but you have to set the row spacing after setting the view definition. Please have a look at the following code

private void Form1_Load(object sender, EventArgs e)
{
    this.radGridView1.Columns.Add(new GridViewTextBoxColumn("A"));
    this.radGridView1.Columns.Add(new GridViewTextBoxColumn("B"));
    this.radGridView1.Columns.Add(new GridViewTextBoxColumn("C"));
    this.radGridView1.Rows.Add("A1", "B1", "C1");
    this.radGridView1.Rows.Add("A2", "B2", "C2");
    this.radGridView1.Rows.Add("A3", "B3", "C3");
      
    ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition();
    view.ColumnGroups.Add(new GridViewColumnGroup("First Group"));
    view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
    view.ColumnGroups[0].Rows[0].Columns.Add(this.radGridView1.Columns["A"]);
    view.ColumnGroups[0].Rows[0].Columns.Add(this.radGridView1.Columns["B"]);
    view.ColumnGroups[0].Rows[0].Columns.Add(this.radGridView1.Columns["C"]);
    radGridView1.ViewDefinition = view;
    this.radGridView1.TableElement.RowSpacing = 10;
}

Hope that helps but let me know if you have any questions
Richard
0
Deepak
Top achievements
Rank 1
answered on 01 Mar 2011, 03:57 PM
yes it does !!
Thanks Richard
0
Richard Slade
Top achievements
Rank 2
answered on 01 Mar 2011, 04:00 PM
You're welcome! - glad I could be of help
Richard
Tags
GridView
Asked by
Deepak
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Deepak
Top achievements
Rank 1
Share this question
or