Hi,
How to get data from grid, Onclick of any server control. Earlier i am using following code to get data from 'asp:Datagrid'.
1.
Code: C#
string UserID = ((TextBox)aspInfoDataGrid.Items[itemCount].Cells[1].FindControl("userID ")).Text;
Following is the code snippet after EOGrid integration.
Code: C#
string userID = EO.Web.GridCell)EOInfoDataGrid.Items[itemCount].Cells[1]).Value.ToString();
After changing to 'EOGrid'. I am getting text as "". What is the error in my code.
2. My grid has "DELETE" column. how to call a event handler on server side.Following is the code snippet. OnItemCommand server event is not firing.
<script language="javascript" type="text/javascript">
function OnItemDelete(grid, itemIndex, colIndex, commandName)
{
//grid.deleteItem(itemIndex);
var item = grid.getSelectedItem();
grid.raiseItemCommandEvent(item.getIndex(), "DELETE");
}
</script>
Code: C#
<eo:Grid id="EOInfoDataGrid" Width="650px" Height="300px" runat="server" AllowColumnReorder="True" EnableViewState="true"
ColumnHeaderDescImage="00050105" ColumnHeaderAscImage="00050104" FixedColumnCount="1" RunningMode="Server"
GoToBoxVisible="True" GridLines="Both" BorderColor="#7F9DB9" GridLineColor="220, 223, 228"
ColumnHeaderDividerImage="00050103" Font-Names="Tahoma" Font-Size="8.75pt" BorderWidth="1px"
FullRowMode="False" Enabled="true" BorderStyle="Solid" OnColumnSort="cctlPatentInfoDataGrid_ColumnSort"
OnItemAdded="cctlPatentInfoDataGrid_ItemAdded" OnItemChanged="cctlPatentInfoDataGrid_ItemChanged"
OnItemCommand="cctlPatentInfoDataGrid_ItemCommand" OnItemDeleted="cctlPatentInfoDataGrid_ItemDeleted"
ClientSideOnItemCommand="OnItemDelete" ClientSideOnCellSelected="cell_selected"cmt:07c1fd43-9658-4620-bbe5-5718de3caad8--
protected void EOInfoDataGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
RMSLogger.Log(_ClientID, _UserID, CATEGORY.Trace, SEVERITY.Level1, TIER.UI_LOGS, "IPIn", "cctlPatentInfoDataGrid_ItemCommand", "Start cctlPatentInfoDataGrid_ItemCommand");
if (e.CommandName == "DELETE")
{
.............
..............
}
}
Thanks in Advance,
Kumar.