I have the following radgrid, when I put the clientevent - OnCommand - "OnGridCommand" the serverevent
OnItemDataBound="gridInvLines_ItemDataBound" is not being called - why is that ? How can I modify the code to call the serverevent or move the server code to client event ?
Basically I am trying to check if the page is valid or not , if the page is valid only then open the popup and load some preexisting values else do not open the popup. The code works except the values are not being generated i.e. OnItemDataBound="gridInvLines_ItemDataBound is not being called ?
<telerik:RadGrid ID="gridInvLines" AllowPaging="False" Skin="Office2007"
runat="server" AutoGenerateColumns="False" DataSourceID="odsInvLines"
GridLines="None" OnItemDataBound="gridInvLines_
<ClientSettings >
<ClientEvents OnKeyPress="disableEnterKey" OnCommand="OnGridCommand" OnPopUpShowing="PopUpShowing" />
</ClientSettings>
<MasterTableView DataKeyNames="LINE_NUMBER" DataSourceID="odsInvLines" EditMode="PopUp" InsertItemDisplay="Top" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" CommandItemDisplay="Top" CommandItemSettings-
<Columns>
<telerik:GridEditCommandColumn ButtonType="LinkButton" InsertText="Save" UniqueName="EditButton">
<ItemStyle HorizontalAlign="Center" Width="30px" />
</telerik:GridEditCommandColum
</Columns>
<EditFormSettings EditColumn-UpdateText="Save" EditColumn-InsertText="Save" CaptionFormatString="Invoice Line Information" ColumnNumber="2">
<FormTableItemStyle Wrap="False" Width="100%"></FormTableItemSt
<FormCaptionStyle CssClass="EditFormHeader" Width="100%"></FormCaptionStyl
<FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White"
Width="100%" />
<FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" Height="110px"
BackColor="White" />
<FormTableAlternatingItemStyle Wrap="False"></FormTableAltern
<PopUpSettings Modal="true" Width="600" />
</EditFormSettings>
</MasterTableView>
<ValidationSettings CommandsToValidate="
//client javascript
function
OnGridCommand(sender, eventArgs){
if(eventArgs.get_commandName() == "Edit" || eventArgs.get_commandName() == "InitInsert" )
{
if (!Page_ClientValidate()) return false;
}
}
//server event
protected void gridInvLines_ItemCommand(objec
{
switch (e.CommandName)
{
case RadGrid.InitInsertCommandName:
e.Canceled =
true;//this is for the Calendar Date control
System.Collections.
if(radBillPeriodStartDate.
newValues[
newValues[
e.Item.OwnerTableView.
default:
break;
}
}