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

[Solved] 2 radGrids on a user control problem

2 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 07 Apr 2008, 08:10 PM
Hi all,

I have a user control that contains 2 Prometheus radGrids, rgInsuredInfo and rgOwnerInfo.  Each of the radGrids has an Edit button that will display a user control that allows the user to make some changes.  But when I click on the Edit button in the second radGrid (rgOwnerInfo), the entire radGrid disappears.  The first radGrid works fine if I click the Edit button.  Is there a problem with having 2 radGrids with Edit buttons on the same user control? 

Here is the markup:

<

table style="width:96%;" align="center">

<tr>

<td>

<telerik:RadGrid ID="rgInsuredInfo"

runat="server"

AutoGenerateColumns="False"

SkinID="GridSkin"

GridLines="None"

AllowPaging="true"

AllowSorting="true"

PagerStyle-Mode="NextPrevAndNumeric"

PageSize="20"

GroupingSettings-CaseSensitive="false">

<MasterTableView GridLines="both"

Name="Master1"

Width="100%"

CommandItemDisplay="Top"

DataKeyNames="EntityID"

HierarchyDefaultExpanded="true"

AllowFilteringByColumn="True" >

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<ExpandCollapseColumn Resizable="False">

<HeaderStyle Width="20px"></HeaderStyle>

</ExpandCollapseColumn>

<Columns>

<telerik:GridBoundColumn UniqueName="EntityID" DataField="EntityID" Visible="false"

ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="LegalFullName" HeaderText="Name" DataField="LegalFullName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="EntityRelatedTypeDesc" HeaderText="Type" DataField="EntityRelatedTypeDesc">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="GenderDesc" HeaderText="Gender" DataField="GenderDesc">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="SmokerStatusDesc" HeaderText="Smoker" DataField="SmokerStatusDesc">

</telerik:GridBoundColumn>

<Telerik:GridEditCommandColumn UniqueName="EditCommandColumn1"

ButtonType="ImageButton"

EditImageUrl="../Images/icon-edit.gif">

</Telerik:GridEditCommandColumn>

<telerik:GridButtonColumn UniqueName="btnDelete"

ButtonType="ImageButton"

ImageUrl="../Images/icon-delete.gif"

ConfirmText="Do you really wish to delete this row?"

CommandName="Delete"

Text="Delete">

</telerik:GridButtonColumn>

<telerik:GridBoundColumn UniqueName="GenderEnumID" Visible="false" DataField="GenderEnumID">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="SmokerStatusEnumID" Visible="false" DataField="SmokerStatusEnumID">

</telerik:GridBoundColumn>

</Columns>

<EditFormSettings UserControlName="PolicyInfoDetails.ascx" EditFormType="WebUserControl">

<EditColumn UniqueName="EditCommandColumn1">

</EditColumn>

</EditFormSettings>

</MasterTableView>

</telerik:RadGrid>

</td>

</tr>

</table>



<

table style="width:96%;" align="center">

<tr>

<td>

<telerik:RadGrid ID="rgOwnerInfo"

runat="server"

AutoGenerateColumns="False"

SkinID="GridSkin"

GridLines="None"

AllowPaging="true"

AllowSorting="true"

PagerStyle-Mode="NextPrevAndNumeric"

PageSize="20"

GroupingSettings-CaseSensitive="false">

<MasterTableView GridLines="both"

Name="Master2"

Width="100%"

CommandItemDisplay="top"

DataKeyNames="EntityID"

HierarchyDefaultExpanded="true"

AllowFilteringByColumn="True">

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<ExpandCollapseColumn Resizable="False">

<HeaderStyle Width="20px"></HeaderStyle>

</ExpandCollapseColumn>

<Columns>

<telerik:GridBoundColumn UniqueName="EntityID" DataField="EntityID" Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="LegalFullName" HeaderText="Name" DataField="LegalFullName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="OwnershipPct" HeaderText="Ownership" DataField="OwnershipPct" DataFormatString="{0:P}">

</telerik:GridBoundColumn>

<Telerik:GridEditCommandColumn UniqueName="EditOwner"

ButtonType="ImageButton"

EditImageUrl="../Images/icon-edit.gif">

</Telerik:GridEditCommandColumn>

</Columns>

<EditFormSettings UserControlName="PolicyInfoOwnerDetails.ascx" EditFormType="WebUserControl">

<EditColumn UniqueName="EditOwner">

</EditColumn>

</EditFormSettings>

</MasterTableView>

</telerik:RadGrid>

</td>

</tr>

</table>

2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 10 Apr 2008, 11:18 AM
Hi Bob,

Do you bind the grids using advanced binding through the NeedDataSource event as demonstrated in this online demo of the product? Note that some operations like data editing, grouping, filtering, etc, require advanced binding in order to function as expected.

Kind regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 10 Apr 2008, 01:18 PM
Stephen,

That was the problem.  I am using the NeedDataSource event but I had both radGrids under the same NeedDataSource event.  When I put each radGrid in their own NeedDataSource event, it worked.

Thanks again for your help.

Bob
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Bob
Top achievements
Rank 1
Share this question
or