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

cell merge causes edit usercontrol to size incorrectly

3 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 23 Jan 2009, 12:25 PM
Hi Everyone,

I have a grid that contains a large number of the same values in each column. I have implemented cell merging by using the Rowspan and setting cells to invisible. This all works great, except when I come to edit a row using a Web Usercontrol, the usercontrol is positioned incorrectly and appears across to the right because the cell in the left most column for the row I have selected to edit is set to visible=false because it is merged with cells in the rows above and below.

How can I get the usercontrol to position correctly when using cell merging?

Thanking you for your time.
Antony

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 23 Jan 2009, 12:29 PM
Hello Antony,

The edit form is placed inside a table cell, which has its colspan attribute set to the number of visible RadGrid columns. Most probably, you need to change the value of that colspan, in accordance with the other merges, that you have made. Use the ItemCreated event to do that.

Sincerely yours,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antony
Top achievements
Rank 1
answered on 23 Jan 2009, 12:43 PM

Hi Dimo,

I am performing the cell merge in the PreRender event, is there a way to tell which row I have selected to edit in the PreRender  then I could leave it out of the merge.

Otherwise is there an example of your solution that uses the ItemCreated event?

 

Many thanks

Antony

0
Accepted
Dimo
Telerik team
answered on 23 Jan 2009, 04:02 PM
Hi Antony,

In this case you should not use ItemCreated, but something like this:

protected void RadGrid_PreRender(object sender, EventArgs e) 
    foreach (GridItem item in (sender as RadGrid).MasterTableView.GetItems(GridItemType.EditFormItem)) 
    { 
        ((item as GridEditFormItem).Cells[1] as TableCell).Attributes["colspan"] = "2"
    } 
 


Sincerely yours,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Antony
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Antony
Top achievements
Rank 1
Share this question
or