|
i m not getting u !
I m not able to see
Go to the last selection criteria --->Misc-> Columns.
Can u please explain me in bit detail?
Please remember mine is VS.NET1.1
C# Windows application
|
|
|
|
|
Well, I am working on 2005 version.
Still, try to choose the property of the data grid which allows you to add columns.
There should be a property called as columns, where you can add the collections.
If you find it, then for every column that you add, you can set resizable to false.
Please see if you can do it.
Keshav Kamat
India
|
|
|
|
|
that's the problem !
there is no such property !
we have to code this and i have tried
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q792q
and
<a http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q872q
but its not working
|
|
|
|
|
I am working on it.
Will let you knw shortly.
Keshav Kamat
India
|
|
|
|
|
if u are working i will let u know my problem !
may it will make a bit easier!
see in the second URL there is a class MyDataGrid which is inherited from DataGrid
which have two protected override funtions OnMouseMove and OnMouseDown which were not working then i realize that may the events should be registered and i tried this syntax to register
this.dataGrid1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove);
this.dataGrid1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown);
where i got errors like
Method 'System.Windows.Forms.Control.OnMouseDown(System.Windows.Forms.MouseEventArgs)' does not match delegate 'void System.Windows.Forms.MouseEventHandler(object, System.Windows.Forms.MouseEventArgs )'
Method 'System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs)' does not match delegate 'void System.Windows.Forms.MouseEventHandler(object, System.Windows.Forms.MouseEventArgs )'
|
|
|
|
|
something like this should work while initializing the component
this.dataGridView1.Columns[0].Resizable.Equals(false);
However, I dont know how far this will work in 2003.
Keshav Kamat
India
|
|
|
|
|
hey u are telling me about 2005 version but mine is 2003:->
|
|
|
|
|
create an event handler for every DataGrid Column and its default width there
myDataGridColumn.WidthChanged+=new EventHandler(myDataGridColumn_WidthChanged);<br />
<br />
private void myDataGridColumn_WidthChanged(object sender, EventArgs e)<br />
{<br />
myDataGridColumn.Width=50;<br />
}
|
|
|
|
|
error
'System.Windows.Forms.DataGrid' does not contain a definition for 'WidthChanged'
|
|
|
|
|
event is not present for data grid its for the DataGride Columns(Which are present in GridColumnStyle)
|
|
|
|
|
ya !
i know !
so do u have any idea what should i have to do?
|
|
|
|
|
go in Property od data grid and then click in TableStyle Then Go to GridColumnStyle. There see the name of your Columns and create event for every Columns as I said
|
|
|
|
|
i have done like this earlier!
but after setting the width when we run the program initially the widht is same as we coded but when mouse moves to the column header it allows user to cahnge the widht and i want to disallow this for user!
i.e. to fix the column width at coding time and disable resizable functioanlity for user.
|
|
|
|
|
dear you must be doing wrong. please reade carefully what i suggested you.
|
|
|
|
|
not getting!
can u explain in detail?
|
|
|
|
|
give me a pm on think2sameer@yahoo.com
|
|
|
|
|
Hello Bhavana,
perhaps this should work.
Search for, where the controls are being initialized. Below the initialization of the datagrid control, each column is being initialized.
for each column, or the column that you require, paste this code
this.Column1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
Please tell me if it works. hopefully, it should.
Keshav Kamat
India
|
|
|
|
|
hey!
since i m using a datatable as datasource for my datagrid and no database connectivity.
the initialize components have the initialization of components,dataGrid and form only and no column initialization there.
i m making datagrid whose datasource is datatable and putting the row elements manually. and i know datagridview(2005) have above properties but datagrid(2003) doesn't ahve these properties.
|
|
|
|
|
Ok. When you load the contents of a database table into the datagrid, get the count of the columns present, and after that for all the columns, you can make sure that the columns cannot be resized.
After loading the database table into the datagrid,
//this will get the count of the columns in the datagrid
DataGridColumnCount=dataGridView1.Columns.Count;
then in a for loop,
set the resizable property of each table to false.
// you are making sure that no column can be resized.
DataGridView1.Columns[i].Resizable=
System.Windows.Forms.DataGridViewTriState.False;
Keshav Kamat
India
|
|
|
|
|
I am not getting the columns property after the datagrid.
Mine is 1.1 version and it doesn't have such properties.
Can u please tell me in VS.NET 1.1?
|
|
|
|
|
Hello everyone, for awhile now I have been developing a notepad with tabs, kind of like the tabs in IE7 or Firefox. Well, it works perfect for the first default tab. And by perfect I mean I can cut,copy,and paste along with use word wrap.
When I go to create a new tab/document I cannot use the cut, copy, paste, and word wrap features. I really am stumped on this seeing how I'm very young and new to the programming world. Would it be possible to give me a little push in the right direction? Or maybe even a decent shove.
Thanks,
Ryan
|
|
|
|
|
I have databinding to a couple of textboxes. When i edit a textbox the data doesn't save unless I click on another control. Any ideas? Thanks to everyone for there help.
Here is the code I use for ending the edit and then updating the database:
BindingContext[DS_Entity1, "EV051"].EndCurrentEdit();
TA_EV051.Update(DS_Entity1.EV051);
|
|
|
|
|
write your update code in TextChange event of text box
|
|
|
|
|
With my app I can't update until the user clicks the save button. Is there a way to accomplish this to not hit update the DB until a toolbutton is hit.
David
|
|
|
|
|
With my app I can't update until the user clicks the save button. Is there a way to accomplish this to not hit update the DB until a toolbutton is hit.
|
|
|
|