or
| <telerik:RadGrid ID="MyRadGrid" runat="server" AllowPaging="True" AllowMultiRowSelection="true" | |
| AutoGenerateColumns="False" AllowAutomaticDeletes="True" AllowMultiRowEdit="true" | |
| AllowAutomaticInserts="False" AllowAutomaticUpdates="False" GridLines="None" | |
| AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="false"> | |
| <ClientSettings Selecting-AllowRowSelect="true"> | |
| </ClientSettings> | |
| <MasterTableView DataKeyNames="MyId" EditMode="EditForms" CommandItemDisplay="Top"> | |
| <RowIndicatorColumn> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </RowIndicatorColumn> | |
| <ExpandCollapseColumn> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </ExpandCollapseColumn> | |
| <Columns> | |
| <telerik:GridDateTimeColumn DataField="date" HeaderText="date" UniqueName="date" | |
| PickerType="DateTimePicker" > | |
| </telerik:GridDateTimeColumn> | |
| </Columns> | |
| </MasterTableView> | |
| <FilterMenu EnableTheming="True"> | |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
| </FilterMenu> | |
| </telerik:RadGrid> |
| void MyRadGrid_ItemCreated(object sender, GridItemEventArgs e) | |
| { | |
| if (e.Item is GridEditableItem && e.Item.IsInEditMode) | |
| { | |
| GridEditableItem item = e.Item as GridEditableItem; | |
| RadDateTimePicker date = item["date"].Controls[0] as RadDateTimePicker; | |
| if (date != null) | |
| date.Calendar.ShowRowHeaders = false; | |
| } |
| <telerik:RadComboBox ID="cmbUnvan" Runat="server" AllowCustomText="True" |
| AutoPostBack="True" EnableLoadOnDemand="True" |
| onitemsrequested="cmbUnvan_ItemsRequested" Height="73px" Width="230px" |
| AutoCompleteSeparator=";" MarkFirstMatch="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| protected void cmbUnvan_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) |
| { |
| RadComboBox combo = (RadComboBox)o; |
| combo.Items.Clear(); |
| SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Personelcon"].ConnectionString; |
| string text = e.Text; |
| string sql = "SELECT * from Unvan WHERE Uname LIKE '" + text.Replace("'", "''") + "%'"; |
| SqlCommand selectCommand = new SqlCommand(sql, connection); |
| SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); |
| DataTable dt = new DataTable(); |
| adapter.Fill(dt); |
| foreach (DataRow row in dt.Rows) |
| { |
| RadComboBoxItem item = new RadComboBoxItem(row["Uname"].ToString()); |
| item.Value = row["Uid"].ToString(); |
| //item.Text = Convert.ToString(row["Uname"]); |
| combo.Items.Add(item); |
| } |
| } |
I have a radgrid which has a OnItemCommand (server event) , when I put in the clienevent OnCommand
the server event is not being fired - any ideas why ? If I remove the clientevent - OnCommand="OnGridCommand" then everything works fine.
| <telerik:RadGrid ID="gridInvLines" AllowPaging="False" Skin="Office2007" |
| runat="server" AutoGenerateColumns="False" DataSourceID="odsInvLines" |
| GridLines="None" OnItemEvent="gridInvLines_ItemEvent" OnItemCommand="gridInvLines_ItemCommand" OnItemDataBound="gridInvLines_ItemDataBound" ShowFooter="True"> |
| <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-AddNewRecordText="Add New Line"> |
| </telerik:RadGrid> |
function gridRequestStart(grid, eventArgs)
{
if((eventArgs.EventTarget.indexOf("exportButton") != -1))
{
eventArgs.EnableAjax =
false;
ExportGrid()
}
}
function ExportGrid()
{
var masterTable = $find("<%=grdPO.ClientID %>").get_masterTableView();
masterTable.exportToExcel();
}
Can you provide any ideas on how to use my page_load functions to set the grid layout once this script has executed ?
Many Thanks
Mark