|
I'm not an expert on this, but whenever I use the datagridviews, I always bind to a dataset or something else behind it. But you also have to define the data types in the dataset as well as the datagrid so it knows how to display it.
|
|
|
|
|
Of course, a have a DataSet1, which is bound with my datagridview. The Table1 is a part of the DataSet1. In Visual Studio-2003 (with DataGrid) all this works just OK. The trouble arises only when I'm starting use VS-2005 and changing DataGrid for DataGridView.
HilSoft
|
|
|
|
|
In C# express I do this:
Create the datagridview, then add the columns that are bound. It looks up the type automatically and lets me select them. You must do define the types in two places, the datagridview and of course in the dataset.
If you program it, rather than allowing the designer to do it for you, you have to set up each column type. Search for "coding datagridview columns".
|
|
|
|
|
Should I write down something like this (see ??? places):
(theGrid.DataMember= "Table1"; // It is so already without programming)
(theTable= theDataSet.Tables[0];)
(theDataSet= (DataSet)(theGrid.DataSource);)
for (i=0; i < val; i++) {
theTable.Columns.Add();
theTable.Columns[i].ColumnMapping= ?????;
}
and below:
for (i=0; i < val; i++) {
acol= new DataGridViewColumn();
acol.CellType= ???;
theGrid.Columns.Add(acol);
}
What do you mean with "define the types"?
HilSoft
|
|
|
|
|
|
Your site reference http://www.rustemsoft.com/DataGridViewColumns.htm is splendid! Thank you very much.
I've found what it’s all about! In my DataGridVies there was designated that
AllowUserToAddRows as False
AllowUserToDeleteRows as False
After setting them to True and using new DataGridViewColumns there occurred blank cells. It is already much better...
When using the old routine I am getting an interruption because of Column Templite (for new column) is not defined. It is much better too.
I'll try investigate further. Thank you.
HilSoft
|
|
|
|
|
Answer is found. There is a quite easy way:
theGrid.AutoGenerateColumns= true;
And the grid arises automatically like the old DataGrid.
HilSoft
|
|
|
|
|
For a treeview i would like to change the mouse cursor to an hour glass after a delay when selected tree nodes take a long time to populate. I was able to do this in VB6 using a timer event, where a busy flag is set and then the timer event checks flag to determine if cursor should be changed to an hour glass. When i try to do similar in C# the cursor does not change. I am able to change the cursor in the code populating the node, but that causes flickering becasue the hourglass is shown even when selected nodes do not take long to populate.
Am i dealing with some kind of multi thread issue here? What is the normal solution?
|
|
|
|
|
when your about to do your complex and time costing code, simply add
this.Cursor = Cursor.Busy;
// your code
this.Cursor = Cursor.Default;
|
|
|
|
|
Hi,
Does anyone know where I can find the Community Server DAAB code? I have downloaded the source SDK, and I am looking for examples on how they insert, update, and delete records using Microsoft's DAAB. I have search through the various namespaces, but could find nothing.
Regards,
ma se
|
|
|
|
|
Hi all,
I have to perform logout when the user is idle for certain time. here iam checking the user idle time in the timer. if the time exceeds 1 hour i logged out the my app. and display messagebox "User logged Out" with Ok button.
my problem is after every 1 hour the messagebox displayed over and over(eg. if the user idle for 10 hrs. 10 message box displayed). how to avoid this. is there any way to check whether the user responded to previous messagebox?. if so we have to display the message else we should not the display the message.
Please help
Srini
|
|
|
|
|
if you are using MessageBox.Show then it is a blocking call and you can do something like this
if(clickedok == true)//make clickedok static or class variable.
{
clickedok = false;
MessageBox.Show("User logged out");
clickedok = true;
}
if it is custom dialog box you can set the flag on onclick event.
Regards
Shajeel
|
|
|
|
|
public bool _isNotified = false;
if(!_isNotified)
{
DialogResult msg = MessageBox.Show("User logged out", "Logout Notification", MessageBoxButtons.OK);
_isNotified = (msg == DialogResult.OK);
}
|
|
|
|
|
_'s _are _completely _a _waste _of _time _and _only _serves _to _make _code _unreadable. _Even _worse _is _using _a _member _where _a _local _will _do.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
ok then....
|
|
|
|
|
Normally I wouldn't complain about something so subjective but I had to be in this morning at 6:30am.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I kinda gathered... Normally your persona is something of a sweeter nature.
|
|
|
|
|
Thanks! thats what i did.
|
|
|
|
|
Hello. I want to get some values with C# from an excel file but I got below error message.
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsApplication1.exe
Additional information: Old format or invalid type library.
I referenced Microsoft Excel 11.0 Object Library and I use .Net 2003. What might be the problem? My codes are below. Thanks.
Excel.Application excelApp = new Excel.ApplicationClass();
excelApp.Visible = true;
string workbookPath = "D:/a.xls";
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath,
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);
|
|
|
|
|
Make sure that you're Main method is marked with the STAThread attribute as all COM Interop requires this.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
I got image icons with different formats, .bmp, .png, .ico.
Which format is the best for use in window applications in
term of loading speed, memory consumption, etc ??
Thanks
|
|
|
|
|
how about not cross posting
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
hi
i have a database in sql server 2000 and i want to set password to my database in i want use it in vc# .. how to do ??
thanks ..
|
|
|
|
|
Umm Can you explain this more clearly please?
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
ok
i want to set passeord on my database in sql server 2000
How to set password for Database access in SQL Server 2000 ???
-- modified at 8:26 Monday 17th July, 2006
|
|
|
|