Welcome Guest Search | Active Topics | Sign In | Register

Getting grid data on server click. Options
bskumar
Posted: Monday, November 2, 2009 8:32:37 AM
Rank: Member
Groups: Member

Joined: 9/22/2009
Posts: 24
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.
eo_support
Posted: Monday, November 2, 2009 8:45:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please go through our documents and samples first. You are using our Grid the same way as standard ASP.NET Grid. These two are VERY different. Once you go over the documentation and samples, you should have some basic idea about how our Grid works.

Thanks
bskumar
Posted: Tuesday, November 3, 2009 8:03:15 AM
Rank: Member
Groups: Member

Joined: 9/22/2009
Posts: 24
Hi,

I fixed the above issues.

Thanks,
Kumar.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.