We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Choosing the "best" grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

20141 Oct 11,2004 10:58 AM Oct 12,2004 03:58 AM Windows Forms 6
loading
Tags: GridControl
vbaker
Asked On October 11, 2004 10:58 AM

I''d appreciate some help choosing the best grid to use for part of an application I am developing. The user is provided with forms for many actual data entry tasks. These forms are typically tabbed dialog boxes with an assortment of controls. A grid is used mainly as a "browsing" aid: Users browse the grid, select the item they want to edit, and then navigate to the data entry form which is populated with the selected item. In this case, in-place editing in the grids is not required or even desired. In fact, we do not want the individual cells in the grid to show an edit cursor, as this would imply that editing is possible. Use of a "hyperlink" cell in a key field could be used to navigate to the data entry form (but, will this work with Windows Forms?) or the user could just double-click in the desired row. The grouping and summary features of the GridGroupingControl are very desirable, but will it support turning editing off entirely? We also like the support for child grids, although it may not be totally necessary. Finally, built-in support for printing the data in the grid is highly desirable. Thanks in advance. --Van Baker

Administrator [Syncfusion]
Replied On October 11, 2004 11:38 AM

If you need the grouping an dsummary support an dyour data is in some kind of DataTable or something, then GridGroupingGrid would be the grid of choice. You can turn off editing using the this.gridGroupingControl1.TableDescriptor.AllowEdit property.

vbaker
Replied On October 11, 2004 01:54 PM

OK. But TableControlCellDoubleClick does not seem to fire when a user clicks on one of the record cells. However, TableControlCurrentCellControlDoubleClick does fire. How do I get the proper values for row, col (adjusted for the headers, nesting level, etc.)in the TableControlCurrentCellControlDoubleClick handler? --Van Baker

Administrator [Syncfusion]
Replied On October 11, 2004 02:10 PM

Try
private void gridGroupingControl1_TableControlCurrentCellControlDoubleClick(object sender, GridTableControlControlEventArgs e)
{
	int row, col;
	Point pt = e.TableControl.PointToClient(Control.MousePosition);;
	if (e.TableControl.PointToRowCol(pt, out row, out col))
		e.TableControl.CurrentCell.AdjustRowColIfCoveredCell(ref row, ref col);
	tableCellStyle = e.TableControl.GetTableViewStyleInfo(row, col);
	contextElement =  tableCellStyle.TableCellIdentity.DisplayElement;
	Console.WriteLine(row.ToString() + "  " + col.ToString());
}

vbaker
Replied On October 11, 2004 03:15 PM

That''s almost exactly what I tried! Now, I think my understanding of the grid geometry is at fault. I wanted to use col to determine the column name of the cell that was clicked and the text value in that cell. So I tired this: string strColName = e.TableControl.TableDescriptor.Columns[col].Name; DataRowView dr = contextElement.GetData() as DataRowView; string strText = dr[strColName].ToString(); This returns the wrong column name and text (offset to the right by one or 2 places, depending on whether it''s a nested grid that was clicked in) What am I doing wrong? --Van Baker

Administrator [Syncfusion]
Replied On October 11, 2004 06:05 PM

If your goal is to get the Text or the Column.Name, you can get these from the tableCellStyle:
private void gridGroupingControl1_TableControlCurrentCellControlDoubleClick(object sender, GridTableControlControlEventArgs e)
{
	int row, col;
	Point pt = e.TableControl.PointToClient(Control.MousePosition);;
	if (e.TableControl.PointToRowCol(pt, out row, out col))
		e.TableControl.CurrentCell.AdjustRowColIfCoveredCell(ref row, ref col);
	tableCellStyle = e.TableControl.GetTableViewStyleInfo(row, col);
  		Console.WriteLine(tableCellStyle.Text +" " + tableCellStyle.TableCellIdentity.Column.Name);
}

vbaker
Replied On October 12, 2004 03:58 AM

That works perfectly! I was trying to get the column information from the TableDescriptor rather than from the TableCellIdentity. To be honest, I find these names a little confusing. This is an awesome product, but the learning curve seems pretty steep. Do you have any docs you''d suggest to help with naming conventions, object model, etc? Again, Thanks! --Van Baker

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;