| <table style="width: 772px" visible="false"> |
| <tr> |
| <td align="right"> |
| <telerik:RadMenu ID="RadMenu1" runat="server" EnableEmbeddedSkins="false"> |
| <Items> |
| <telerik:RadMenuItem Text="CashFlow"> |
| <Items> |
| <telerik:RadMenuItem Text="toto" /> |
| <telerik:RadMenuItem Text="tata" /> |
| </Items> |
| </telerik:RadMenuItem> |
| </Items> |
| </telerik:RadMenu> |
| <asp:Button CssClass="green_button" ID="Btn1" runat="server" Text="Btn 1" UseSubmitBehavior="false" /> |
| <asp:Button CssClass="green_button" ID="Btn2" runat="server" Text="Btn 2" |
| UseSubmitBehavior="false"/> |
| </td> |
| </tr> |
| </table> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| AllowSorting="True" |
| AutoGenerateDeleteColumn="True" |
| AutoGenerateEditColumn="True" oncolumncreated="RadGrid1_ColumnCreated" |
| ondatabound="RadGrid1_DataBound" |
| onneeddatasource="RadGrid1_NeedDataSource" |
| onitemupdated="RadGrid1_ItemUpdated" onrowdrop="RadGrid1_RowDrop" |
| onupdatecommand="RadGrid1_UpdateCommand" |
| AllowMultiRowEdit="True" |
| > |
| <MasterTableView DataKeyNames ="cID" EditMode="InPlace"> |
| ... |
| if (mydt.PrimaryKey == null || mydt.PrimaryKey.Length<1) |
| { // if there is no primary |
| DataColumn col = new DataColumn("cID", typeof(int)); |
| col.AutoIncrement = true; |
| mydt.Columns.Add(col); |
| int rc = 0; |
| foreach (DataRow drw in mydt.Rows){ rc++; drw["cID"] = rc;}//fill for existing rows |
| mydt.PrimaryKey = new DataColumn[] { mydt.Columns["cID"] }; |
| } |
| nDS.Tables[0].Columns["cID"].ReadOnly = true; |
| RadGrid1.DataSource = nDS.Tables[0]; |
| RadGrid1.AutoGenerateColumns = false; |
| GridBoundColumn boundColumn; |
| boundColumn = new GridBoundColumn(); |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.DataField = "cID"; |
| boundColumn.HeaderText= "id"; |
| bool ised = boundColumn.IsEditable; //RETURNS TRUE ! |
This may be a beginner’s issue, but I am having trouble with a situation that I need help with. One set of data that is stored in an ArrayList and another that is stored in the DB (results from a stored procedure).
I need to have a RadGrid with two columns (right now the RadGrid is on the .aspx page, but the datasource is binded in the code-behind). The first column’s cell’s will all have different values, but the second column should have a dropdown list populated with the same data in each cell (e.g. product list). Essentially the data in column 1 will not be editable, but the value in each cell/drop down for column 2 needs to be selectable. The data is column 1 is not stored in the DB (it is from an ArrayList that is built from reading data from a file the user just uploaded), while the data that would be in the drop downs in column 2 is from the results of a stored procedure in the DB. It is a mapping exercise where the user must match an item from the array list to an item from the drop down list then save the changes for each row or the RadGrid as a whole.
ArrayList Column DropDownListColumn (Each row should have a dropdown list with the same choices, populated from the same stored procedure call)
ArrayListString(i) DropDownList
Does something like a datatable/dataset need to be built programatically in the background? Could you please show me how to do this?
| DockCommand editCmd = new DockCommand(); |
| editCmd.Name = "Edit"; |
| editCmd.Text = "Edit"; |
| editCmd.CssClass = "rdCustom"; |
| dock.Commands.Insert(0, editCmd); |
Problem is the command appears at the end of all commands,
I want it to appear in order "edit","min-max","close"
Please suggest syntax.
Thanks.
| <EditFormSettings CaptionFormatString="Edit Application Record: {0}" |
| CaptionDataField="advertisor_site" EditFormType="Template"> |
| <EditColumn UniqueName="EditCommandColumn1"></EditColumn> |
| <FormTemplate> |
| <asp:Label ID="GridRecEdit" runat="server" Visible="false" |
| Text='<%# Eval("record") %>' /> |
| <asp:SqlDataSource ID="sqlds_AppEditor" runat="server" |
| ConnectionString="<%$ ConnectionStrings:Company_Master_ConnectionString %>" |
| SelectCommand="sp_Select_Admin_Application_Details" |
| SelectCommandType="StoredProcedure"> |
| <SelectParameters> |
| <asp:ControlParameter ControlID="GridRecEdit" PropertyName="Text" Type="Int32" Name="Record" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <table> |
| ALL OF MY ROWS & COLUMNS HERE |
| ... |
| <tr> |
| <td> |
| Name:</td> |
| <td> |
| <asp:TextBox ID="last_name" runat="server" Text='<%# Bind("last_name") %>' |
| CssClass="FormBox" MaxLength="40"/> |
| , |
| <asp:TextBox ID="first_name" runat="server" |
| Text='<%# Bind("first_name") %>' CssClass="FormBox" MaxLength="30"/> |
| </td></tr> |
| ... |
| </table> |
| </FormTemplate> |
| <PopUpSettings ScrollBars="None" Width="85%"></PopUpSettings> |
| </EditFormSettings> |