Hi
I am using DevExpress Aspx Gridview and it is bound with ObjectDataSource. The select method "GetAllEmployees" for the datasource is written in a class EmployeeBusinessClass
In GetAllEmployees method, i am using DataAccessAdapter method **FetchTypedList(ITypedListLgp2,IPredicateExpression,Int32,ISortExpression,Boolean) **
The return type of the GetAllEmployees function is EmployeeTypedList.
The grid is bound successfully and all employees are loaded in the gridview. When i click on the Edit button against a row in gridview, employee's data (Employee Name) is loaded in a textbox, but that textbox remains disabled and i couldn't edit data in that textbox. I couldn't understand why textbox is disabled on editing a row.
If I use the simple sqlDataAdapter to fill DataSet and bind gridvew with DataSet's DataTable, then on Click edit button textbox will be enabled for editing.
e.g
SqlConnection conn = new SqlConnection(_connectionString);
SqlDataAdapter da = new SqlDataAdapter(sqlCmd, conn);
DataSet ds = new DataSet();
conn.Open();
da.Fill(ds,"Employees");
conn.Close();
return ds.Tables["Employees"];
But by using FetchTypedList method, it is not worked properly.
Aspx GridView
<dxwgv:ASPxGridView ID="GridViewEmployees" ClientInstanceName="GridViewEmployees"
runat="server" AutoGenerateColumns="False" Width="600px" KeyFieldName="EmployeeID" DataSourceID="EmployeeDataSource" >
<Columns>
<dxwgv:GridViewCommandColumn VisibleIndex="0" Width="150px" >
<EditButton Visible="True" >
</EditButton>
<NewButton Visible="True">
</NewButton>
<DeleteButton Visible="True" >
</DeleteButton>
</dxwgv:GridViewCommandColumn>
<dxwgv:GridViewDataTextColumn SortOrder="Descending" FieldName="EmployeeID" VisibleIndex="1" ReadOnly="True" >
<EditFormSettings Visible="False" />
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataMemoColumn FieldName="EmployeeName" VisibleIndex="2">
</dxwgv:GridViewDataMemoColumn>
</Columns>
<SettingsEditing Mode="Inline" />
</dxwgv:ASPxGridView>
<asp
bjectDataSource ID="EmployeeDataSource" runat="server" DeleteMethod="DeleteAgentNote"
InsertMethod="InsertEmployee" SelectMethod="GetAllEmployees" TypeName="EmployeeBusinessClass"
UpdateMethod="UpdateEmployee">
<UpdateParameters>
<asp
arameter Name="EmployeeName" Type="Int32" />
<asp
arameter Name="EmployeeID" Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:P arameter Name="EmployeeID" Type="String" DefaultValue="150" />
</SelectParameters>
<InsertParameters>
<asp:P arameter Name="EmployeeName" Type="String" />
</InsertParameters>
</asp:o bjectDataSource>