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

[Solved] Having problems with client side select and GridTemplateColumn

5 Answers 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Loy Chan
Top achievements
Rank 1
Loy Chan asked on 24 Apr 2008, 09:23 PM
I have a RadGrid that contains a template column like the following:

<rad:GridTemplateColumn UniqueName="Name" SortExpression="Name">  
    <ItemTemplate> 
        <asp:Repeater ID="rptClientName" runat="server" > 
            <HeaderTemplate> 
                <table> 
            </HeaderTemplate> 
            <ItemTemplate> 
                <tr> 
                    <td><asp:Label ID="lblClientName" runat="server" /></td>  
                </tr> 
            </ItemTemplate> 
            <FooterTemplate> 
                </table> 
            </FooterTemplate> 
        </asp:Repeater> 
    </ItemTemplate>                                      
</rad:GridTemplateColumn> 

Everything looks fine but if I try want to select the row (and have it highlighted), the row will only be selected if I select any other part of the row except for the table that is created within the repeater.

Any suggestions?

Thanks

5 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 25 Apr 2008, 11:42 AM
Hi Loy Chan,

The markup below produces invalid HTML. Does the problem persist if you either move the table tags within the ItemTemplate or the whole repeater withing the table cell?

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Loy Chan
Top achievements
Rank 1
answered on 25 Apr 2008, 02:39 PM
Hi,

I don't agree that the posted code will produce invalid html. I've seen multiple example of this technique to create a multi-row table via a repeater.

When I look at the HTML that is generated by the repeater, there's nothing wrong with the table html.

I did try to put the table tags within the ItemTemplate and found that there was no change in the behavior that I am experiencing.

As to your 2nd suggestion of putting the entire repeater into a table cell, this change would not produce the visual results that I desire.

Loy.
0
Konstantin Petkov
Telerik team
answered on 29 Apr 2008, 06:31 AM
Hi Loy,

I just checked if the row selection conflicts with template column, but it is selected properly. Here is an example:

http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/GeneralFeatures/ColumnTypes/DefaultCS.aspx

You can customize the table inside ItemTemplate according to your requirements.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Loy Chan
Top achievements
Rank 1
answered on 29 Apr 2008, 02:01 PM
In your example, you will notice that if you try to click on the text or the area immediately around that text (ie. the table), the row does NOT get selected.
0
Konstantin Petkov
Telerik team
answered on 30 Apr 2008, 06:42 AM
Hi Loy,

This is indeed a problem with the table. We are aware of the issue and we will look into resolving it for the subsequent version of the products.

In the meantime you can build the layout through divs instead of a table. Please, excuse us for the temporary inconvenience.

Regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Loy Chan
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Loy Chan
Top achievements
Rank 1
Share this question
or