I've got a Radgrid with about 20 rows, each one of which has a RadSlider in an ItemTemplate, databound with DataBinder.Eval. I have the AutoPostback property set to true, and have a RadSlider1_ValueChanged function in my codebehind. All that works.
However, I can't find a way to differentiate *which* slider had its value changed. I know the new value, but that doesn't do a lot of good when there were so many old values.
ASPX:
C#:
....There has to be some way to get back to the data from the original row, right?
However, I can't find a way to differentiate *which* slider had its value changed. I know the new value, but that doesn't do a lot of good when there were so many old values.
ASPX:
| <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowSorting="False" |
| AutoGenerateEditColumn="True" ShowGroupPanel="false" AutoGenerateColumns="False" |
| AllowAutomaticUpdates="True" Skin="WebBlue" OnNeedDataSource="RadGrid1_NeedDataSource" |
| OnUpdateCommand="RadGrid1_UpdateCommand"> |
| <MasterTableView GroupsDefaultExpanded="true" GroupHeaderItemStyle-CssClass="custom_GroupHeader" |
| CommandItemDisplay="None" EditMode="InPlace"> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldName="CategoryName" FieldAlias="Category" FormatString="{0}" |
| HeaderValueSeparator=": " /> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldAlias="CategoryOrder" FieldName="CategoryOrder" /> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <Columns> |
| <telerik:GridBoundColumn DataField="AttributeName" HeaderText="Attribute" SortExpression="AttributeName" |
| UniqueName="AttributeName" ReadOnly="True" /> |
| <telerik:GridTemplateColumn DataField="Rating" HeaderText="How Much?" UniqueName="Rating"> |
| <ItemTemplate> |
| <telerik:RadSlider ID='RadSlider1' runat="server" MinimumValue="-3" MaximumValue="3" |
| AutoPostBack="true" OnValueChanged="RadSlider1_ValueChanged" SlideStep="1" Skin="WebBlue" |
| Value='<%# DataBinder.Eval(Container.DataItem, "Rating") %>' Orientation="Horizontal" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
C#:
| protected void RadSlider1_ValueChanged(object sender, EventArgs e) |
| { |
| Telerik.Web.UI.RadSlider myControl = (Telerik.Web.UI.RadSlider)sender; |
| Int32 newValue = myControl.Value; |
| } |
....There has to be some way to get back to the data from the original row, right?