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

[Solved] radgrid row

2 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dwarak kanniah
Top achievements
Rank 1
dwarak kanniah asked on 26 Nov 2009, 10:27 AM
Hi,
  1) I create radgrid datasource from datatable dynamically(headers are not fixed).how to change the columnspan ,rowspan and change style of entire row.

 2) how to print the contents of radgrid.


Thanks
 Dwarak 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Nov 2009, 11:42 AM
Hello Dwarak,

1)You can dynamically add an ItemDataBound event handler for the grid and try the following code to set the row span, column span and row styles for the grid:
c#:
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        (sender as RadGrid).ItemStyle.CssClass = "myrow";  
        (sender as RadGrid).AlternatingItemStyle.CssClass = "myaltrow";  
  
        if (e.Item is GridDataItem)  
        {  
            foreach(GridColumn col in (sender as RadGrid).MasterTableView.RenderColumns)  
            {  
                GridDataItem dataItem = (GridDataItem)e.Item;  
                dataItem[col.UniqueName].ColumnSpan = 2;  
                dataItem[col.UniqueName].RowSpan = 2;  
            }  
        }  
    }  

2)Refer to the following code library submission to print grid contents:
Print RadGrid contents

Thanks
Princy.
0
dwarak kanniah
Top achievements
Rank 1
answered on 27 Nov 2009, 04:44 AM
I am able to create a colspans. but the I am able to see the remaining cells. I should remove those. Is there any way to do tat.

Thanks

Dwarak.
Tags
Grid
Asked by
dwarak kanniah
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
dwarak kanniah
Top achievements
Rank 1
Share this question
or