or
<
telerik:RadGrid
ID
=
"radGrdDetails"
runat
=
"server"
EnableLinqExpressions
=
"false"
AllowPaging
=
"False"
AllowSorting
=
"True"
GridLines
=
"None"
Skin="<%$ AppSettings: YALSkin%>"
AllowAutomaticInserts="False" AllowAutomaticUpdates="false" AllowMultiRowEdit="false" showstatusbar="true" Width="800" AllowFilteringByColumn="true" AutoGenerateColumns="false" AutoGenerateEditColumn="false">
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ID"
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridEditCommandColumn
/>
<
telerik:GridBoundColumn
UniqueName
=
"ID"
ReadOnly
=
"true"
Visible
=
"false"
DataField
=
"ID"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"NUMBER"
ReadOnly
=
"true"
DataField
=
"NUMBER"
HeaderText
=
"Number"
SortExpression
=
"NUMBER"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"TYPE"
ReadOnly
=
"true"
DataField
=
"TYPE"
HeaderText
=
"Type"
SortExpression
=
"TYPE"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"COUNTY"
DataField
=
"COUNTY"
HeaderText
=
"County"
SortExpression
=
"COUNTY"
></
telerik:GridBoundColumn
>
</
Columns
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected
Sub
radGrdDetails_UpdateCommand(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
radGrdDetails.UpdateCommand
Dim
oldValues, newValues, changedValues
As
Hashtable
newValues =
New
Hashtable
changedValues =
New
Hashtable
Dim
editedItem
As
GridEditableItem =
CType
(e.Item, GridEditableItem)
oldValues = editedItem.SavedOldValues
editedItem.ExtractValues(newValues)
For
Each
key
As
String
In
oldValues.Keys
If
oldValues(key) = newValues(key)
Then
'field has not changed, don't edit
Else
'field has changed
changedValues.Add(key, newValues(key))
End
If
Next
End
Sub
RadTextBox item1 = userControl1.Item1TextBox;
InsertItem(item1.Text);
protected override void OnInit(EventArgs e)
{
base.OnInit(e)
RadGrid1.Skin = Skin;
RadGrid1.Width = GridWidth;
RadGrid1.AutoGenerateColumns = false;
RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
RadGrid1.NeedDataSource += RadGrid1_InsertCommand;
RadGrid1.NeedDataSource += RadGrid1_UpdateCommand;
RadGrid1.NeedDataSource += RadGrid1_DeleteCommand;
RadGrid1.MasterTableView.Width = Unit.Percentage(100);
RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;
RadGrid1.MasterTableView.CommandItemSettings.ShowRefreshButton = false;
RadGrid1.MasterTableView.ShowHeadersWhenNoRecords = true;
RadGrid1.MasterTableView.EditFormSettings.UserControlName = "/includes/userControls/RoofForm.ascx";
RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
RadGrid1.MasterTableView.DataKeyNames = DataKeys;
}
RadGrid1.MasterTableView.EditFormSettings.UserControlName = "/includes/userControls/RoofForm.ascx";
RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
So my question is: Is it possible to access these public properties which return a control in the InsertCommand/UpdateCommand bindings or am I forced to use the FindControl?
For example:
protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
UserControl userControlForm= e.Item.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl;
RadComboBox item1 = userControlForm.Property1;
RadComboBox item2 = userControlForm.Property2;
RadComboBox item3 = userControlForm.Property3;
RadComboBox item4 = userControlForm.Property4;
RadComboBox item5 = userControlForm.Property5;
RadDatePicker item6 = userControlForm.Property6;
RadNumericTextBox item7 = userControlForm.Property7;
RadNumericTextBox item8 = userControlForm.Property8;
if (insert(item1.text, item2.text, item3.text, item4.text, etc..)
{
ErrorMessages.Text += "<
br
/>The item was saved but there were other errors";
}
else
{
AllSaved = false;
ErrorMessages.Text += "<
br
/>The item was not saved. Please go to the parent entry to add the item.";
}
}
If this isn't clear let me know and I will be happy to elaborate.
div.RadGrid_Windows7 .RadGridSelectedItem
{
color:black !important;
background:none !important;
background-color:#0080FF !important;
}
But I cannot figure out how to style the row hover. From articles I have tried this:
.GridRowOver_Windows7
{
color:black !important;
background:none !important;
background-color:#0080FF !important;
}
The client side to server side grab of selected rows datakeyvalues is more important to me however. Thanks in advance for any wisdom and know how you may provide!<
httpHandlers
>
<
remove
verb
=
"*"
path
=
"*.asmx"
/>
<
add
verb
=
"*"
path
=
"*.asmx"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"*"
path
=
"*_AppService.axd"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
validate
=
"false"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
verb
=
"*"
precondition
=
"integratedMode"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
/>
</
httpHandlers
>
<
httpModules
>
<
add
name
=
"RadUploadModule"
precondition
=
"integratedMode"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
</
httpModules
>