Hi,
I have a grid that among the columns has 2 template columns that have editors present. One of them selects whether or not the row is relevant and the other allows the entry of some text.
This all works fine on the client but once the form comes back to the server I only see the original values that the controls in the 2 columns were set to - not any changed values.
The columns are as below (they get setup with the correct values via the ItemDataBound event):
The code behind is as below:
Any suggestions on what I'm doing wrong or if it can't be done like this. If not I suppose that I can knock up some client side javascript to handle it but would prefer not to. I've seen other examples and they seem to indicate that this should work..
Best Regards,
Jon
I have a grid that among the columns has 2 template columns that have editors present. One of them selects whether or not the row is relevant and the other allows the entry of some text.
This all works fine on the client but once the form comes back to the server I only see the original values that the controls in the 2 columns were set to - not any changed values.
The columns are as below (they get setup with the correct values via the ItemDataBound event):
<
telerik:GridTemplateColumn
DataField
=
"Selected"
HeaderText
=
"Use?"
UniqueName
=
"uxSelected"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"uxSelectedCheckbox"
runat
=
"server"
Enabled
=
"true"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"SackColourRcGcBc"
HeaderText
=
"Custom Colour"
UniqueName
=
"uxSackColourRcGcBc"
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"uxSackColourRcGcBcTextbox"
runat
=
"server"
Width
=
"80px"
AutoPostBack
=
"False"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
The code behind is as below:
Dim
idString
As
String
=
""
Dim
colourString
As
String
=
""
Try
For
Each
item
As
GridDataItem
In
DirectCast
(uxFormView.FindControl(
"uxRadGrid"
), RadGrid).Items
Dim
SackTypeID
As
String
= item.GetDataKeyValue(
"SackTypeID"
).ToString()
If
CType
(item(
"uxSelected"
).FindControl(
"uxSelectedCheckbox"
), System.Web.UI.WebControls.CheckBox).Checked
Then
idString += SackTypeID +
"!"
If
ConvertRGBToHTMLColour(
CType
(item(
"uxSackColourRcGcBc"
).FindControl(
"uxSackColourRcGcBcTextbox"
), RadTextBox).Text) <>
""
Then
colourString +=
CType
(item(
"uxSackColourRcGcBc"
).FindControl(
"uxSackColourRcGcBcTextbox"
), RadTextBox).Text
End
If
colourString +=
"!"
End
If
Next
Catch
ex
As
Exception
End
Try
Any suggestions on what I'm doing wrong or if it can't be done like this. If not I suppose that I can knock up some client side javascript to handle it but would prefer not to. I've seen other examples and they seem to indicate that this should work..
Best Regards,
Jon