would it be possible that i create two WEB User Control for radgrid edit mode? Different input will show different edit form display. it's totally different control. visible some control cannot be applied here. For input A, the radgrid will visible the control A and if input B, the radgrid will visible the control B. Belows are part of my code:
<EditFormSettings UserControlName = "ByDepartment.ascx" EditFormType = "WebUserControl">
</EditFormSettings>
<EditFormSettings UserControlName = "ByEngineer.ascx" EditFormType = "WebUserControl"></EditFormSettings>
</telerik:GridTableView>
</DetailTables>
<ExpandCollapseColumn Visible="True">
</ExpandCollapseColumn>
<Columns>
| toolbar.FindItemByText("text").Visible = false; // This has no effect |
| toolbar.FindButtonByCommandName("command")... // No Visible property here |
| (toolbar.FindButtonByCommandName("command") as RadToolBarItem).Visible = false; // This has no effect |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "RowClick" && e.Item is GridDataItem) |
| { |
| GridEditableItem eeditedItem = e.Item as GridEditableItem; |
| int customerId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerId"]); |
| } |
| } |
use the above code block to take CustomerId of selected customer which was written by one of board members. But I have no datakeyvalues because mygridview use needdatasource and advance binding as below
| protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| RadGrid1.DataSource = GetDataTable("SELECT Customerid,CustomerName,CustomerSurname FROM Customers "); |
| } |