Hi,
I have a rad grid inside a repeater and all i want to do is get the row select to fire some server side code but I can not get the code to fire.
<asp:Repeater ID="rptExaminations"
runat="server"
OnItemDataBound="rptExaminations_ItemDataBound"
OnItemCommand="rptExaminations_ItemCommand"
EnableViewState="true">
<ItemTemplate>
<asp:Label ID="lblExaminationReference" runat="server" CssClass="summaryHeading"></asp:Label>
.......
<atkins:RadGrid ID="grdExhibits"
runat="server"
AutoGenerateColumns="False"
AllowSorting="False"
AllowPaging="False"
AllowMultiRowSelection="false"
GridLines="None"
ClientSettings-EnableRowHoverStyle="true"
>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView NoMasterRecordsText="There are no exhbits">
<Columns>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="25px" ItemStyle-Width="25px" CommandArgument="ExhibitSelected" />
<telerik:GridBoundColumn HeaderText="Witness Ref" UniqueName="WitnessReference" DataField="WitnessRef"
HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Barcode" UniqueName="BarCode" DataField="Barcode"
HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Short Description" UniqueName="ShortDescription"
DataField="ShortDescriptionId" HeaderStyle-Width="75px">
</telerik:GridBoundColumn>
<atkins:GridExpandTextColumn HeaderText="Description" UniqueName="Description" DataField="Description">
</atkins:GridExpandTextColumn>
<telerik:GridBoundColumn HeaderText="Current Location" UniqueName="CurrentLocation"
DataField="Location" HeaderStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Seized By" UniqueName="ObtainedBy" DataField="ObtainedById"
ItemStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Date / Time Seized" UniqueName="SeizedDate"
DataField="DateTimeObtained" DataFormatString="{0:mm/dd/yyyy hh:mm}" HeaderStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Property Reference Number" UniqueName="PropertyReferenceNumber"
DataField="CPR" HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<atkins:GridExpandTextColumn HeaderText="Remarks" UniqueName="Remarks" DataField="AppendRemarks">
</atkins:GridExpandTextColumn>
</Columns>
</MasterTableView>
</atkins:RadGrid>
<br class="clear" />
</ItemTemplate>
</asp:Repeater>
#region examinations repeater
protected void rptExaminations_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
{
return;
}
else
{
// populate the exhibits
Atkins.Locard.Web.Controls.RadGrid grdExhibits = (Atkins.Locard.Web.Controls.RadGrid)e.Item.FindControl("grdExhibits");
grdExhibits.DataSource = examination.Exhibits;
grdExhibits.DataBind();
}
}
protected void rptExaminations_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
if (e.CommandName == "ExhibitSelected")
{
//todo
int selectedIndex = rtsExaminations.SelectedIndex;
RepeaterItem repeaterItem = rptExaminations.Items[selectedIndex];
RadGrid grdExhibits = (RadGrid)repeaterItem.FindControl("grdExhibits");
if (grdExhibits.SelectedItems.Count == 1)
{
GridItem gridItem = grdExhibits.SelectedItems[0];
BarCode = gridItem.Attributes["BarCode"].ToString();
}
else
{
BarCode = "";
}
}
}
#endregion
I'm sure its something simple i'm missing
I have a rad grid inside a repeater and all i want to do is get the row select to fire some server side code but I can not get the code to fire.
<asp:Repeater ID="rptExaminations"
runat="server"
OnItemDataBound="rptExaminations_ItemDataBound"
OnItemCommand="rptExaminations_ItemCommand"
EnableViewState="true">
<ItemTemplate>
<asp:Label ID="lblExaminationReference" runat="server" CssClass="summaryHeading"></asp:Label>
.......
<atkins:RadGrid ID="grdExhibits"
runat="server"
AutoGenerateColumns="False"
AllowSorting="False"
AllowPaging="False"
AllowMultiRowSelection="false"
GridLines="None"
ClientSettings-EnableRowHoverStyle="true"
>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView NoMasterRecordsText="There are no exhbits">
<Columns>
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="25px" ItemStyle-Width="25px" CommandArgument="ExhibitSelected" />
<telerik:GridBoundColumn HeaderText="Witness Ref" UniqueName="WitnessReference" DataField="WitnessRef"
HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Barcode" UniqueName="BarCode" DataField="Barcode"
HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Short Description" UniqueName="ShortDescription"
DataField="ShortDescriptionId" HeaderStyle-Width="75px">
</telerik:GridBoundColumn>
<atkins:GridExpandTextColumn HeaderText="Description" UniqueName="Description" DataField="Description">
</atkins:GridExpandTextColumn>
<telerik:GridBoundColumn HeaderText="Current Location" UniqueName="CurrentLocation"
DataField="Location" HeaderStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Seized By" UniqueName="ObtainedBy" DataField="ObtainedById"
ItemStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Date / Time Seized" UniqueName="SeizedDate"
DataField="DateTimeObtained" DataFormatString="{0:mm/dd/yyyy hh:mm}" HeaderStyle-Width="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Property Reference Number" UniqueName="PropertyReferenceNumber"
DataField="CPR" HeaderStyle-Width="150px">
</telerik:GridBoundColumn>
<atkins:GridExpandTextColumn HeaderText="Remarks" UniqueName="Remarks" DataField="AppendRemarks">
</atkins:GridExpandTextColumn>
</Columns>
</MasterTableView>
</atkins:RadGrid>
<br class="clear" />
</ItemTemplate>
</asp:Repeater>
#region examinations repeater
protected void rptExaminations_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
{
return;
}
else
{
// populate the exhibits
Atkins.Locard.Web.Controls.RadGrid grdExhibits = (Atkins.Locard.Web.Controls.RadGrid)e.Item.FindControl("grdExhibits");
grdExhibits.DataSource = examination.Exhibits;
grdExhibits.DataBind();
}
}
protected void rptExaminations_ItemCommand(object sender, RepeaterCommandEventArgs e)
{
if (e.CommandName == "ExhibitSelected")
{
//todo
int selectedIndex = rtsExaminations.SelectedIndex;
RepeaterItem repeaterItem = rptExaminations.Items[selectedIndex];
RadGrid grdExhibits = (RadGrid)repeaterItem.FindControl("grdExhibits");
if (grdExhibits.SelectedItems.Count == 1)
{
GridItem gridItem = grdExhibits.SelectedItems[0];
BarCode = gridItem.Attributes["BarCode"].ToString();
}
else
{
BarCode = "";
}
}
}
#endregion
I'm sure its something simple i'm missing