|
Hello,
Infact i want to display it in all cells. I have been succeded in doing that, Now i want to handle the event of that control. I have writeen the code in my first post. I dont know that y these events do not get triggered.
Let me make it simple, forget about custom control.
say i want to handle the events of button in DataGridViewButtonColumn, tell me how i will do that?
Thanx
sorry for my bad English.
|
|
|
|
|
Hello
Now I got your problem... Actually custom DatagridView columns are inherited -after some fathers- from DataGridViewElemnt . In that class you will find protected methods called RaiseCellClick() , RaiseCellContentClick() , among other methods to raise the events DatagridView.CellClick event, and DataGridView.CellContentClick . So the control that will handle the events is the DataGridView actually by the above events. If your custom control doesn't fire these events automatically -I don't know how you implemented them!-, so when you see suitable fire them yourself using the Raise methods.
Regards
|
|
|
|
|
Thanx Nader for your help
public override void InitializeEditingControl(int rowIndex, object<br />
initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)<br />
{<br />
ase.InitializeEditingControl(rowIndex, initialFormattedValue,<br />
dataGridViewCellStyle);<br />
DXTextBoxButtonColumnEditingControl ctl =<br />
DataGridView.EditingControl as DXTextBoxButtonColumnEditingControl;<br />
if(ctl !=null)<br />
if (this.Value != null)<br />
ctl.SSTextBox.Text = (string)this.Value;<br />
else<br />
ctl.SSTextBox.Text = string.Empty;<br />
}
i want this ctl to be accessed in the form where datagridcolumn will be used.
Thanx
sorry for my bad English.
|
|
|
|
|
Hello
I'm sorry my reply came very late, but your email notification arrived to my just now!!
You can't acess ctl this way because you've declared it as a local variable in a method. Declare it as a public member in your class, and access it like MyCustomColumn.ctl.Click for the click event as an example.
I don't know if my reply would help you or it came too late, but forgive me.
Regards
|
|
|
|
|
my problem is the following:
i have one combobox that sometimes i want show a item and sometimes not. this combox is binded to a dataset. is there on elegant way to do it without inserting and deleting a element is the dataset all the time depending the context? if don`t, how can i do that in a better way?
thanks
|
|
|
|
|
u can create dataview from dataset and can filter data from dataset
and then can bind it to combobox
rahul
|
|
|
|
|
i got it, but, dont u have an example? i have never used this.
|
|
|
|
|
i have found one in VB:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
da1.Fill(ds, "Autores1")
Dim dv As New DataView(ds.Tables("Autores"))
dv.RowFilter = "Au_ID <= 15"
DataGrid1.DataSource = dv
End Sub
however, i think it`s all that i need
thanks
|
|
|
|
|
|
Maybe Delete() and CancelChanges() on the underlying row ?
|
|
|
|
|
it doesn`t sound good...
i have solved my problem using dataview yet.
|
|
|
|
|
i have SQL Server Database with very important information
1 - i want to make backup to my database every 1 hour
2- i want to send my database file to ftp with differ name
how can make my program to do this automaticly .....
Palestine
|
|
|
|
|
You can configure it in SQL Server
only two letters away from being an asset
|
|
|
|
|
You can write a WindowsService and make this service start your processes whenever you want (in this case when the DateTime.Minute = 0)..
not an expert suggestion just an idea
.:: Something is Wrong ::.
|
|
|
|
|
i have datagrid it includes ID columne if i deleted the ID from the grid then i select the row to delete it i resived exeption
how can handle this excption???
fatma
|
|
|
|
|
btota wrote: how can handle this excption???
First by not causing it and second by saying WHAT exception you are getting.
only two letters away from being an asset
|
|
|
|
|
how to Reduce the width of datagrid colum in c# ??
sikandar
|
|
|
|
|
u have to use DataGridTextBoxColumn object which has width property
after setting width u have to add it to DataGridTableStyle object
and finally u have to add this DataGridTableStyle object to datgrids TableStyles
property.
rahul
|
|
|
|
|
I have a class named operator, please tell me, how do I get use it in the main program if I want to access it with a button with the name button1.
And also how do I get to show the results in a new window?
tony-yeyo
|
|
|
|
|
*sigh* buy a book, and work through it. You're never going to learn if you come to these forums without the slightest idea of how to apply the things people tell you.
If you double click on a button in the designer you will create an event for the click. What do you want the class to do ? You can have an instance as a member variable, or create a local instance in that class, and call it.
If you have results from the class and want to show them, the easiest way is a messagebox, otherwise you need to create a new form class. If you do this, unless the operator class instance is a member for some reason, I'd do the operation inside that form, so your event just shows the dialog and the form itself performs the operation and shows the result. Otherwise, I'd pass the result through the constructor.
And again, if you don't know what any of that means, buy a book and work through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
u can create instance of class on button1_click event
operator op = new operator();
and then can access public members and public methods of class operator
by its object op.
rahul
|
|
|
|
|
Hi All,
I am using MDI form, The first 20% of the form am displaying Treeview control and in the rest of the portion am displaying a mdiChild form. The mdiChild form has got few UI controls on which tab order is set.
Now the issues is, when we hit on tab, it revolves within the child form. How can i make it to go to treeview control once the last control on the child form is focus? ie. on being on the last control and hit tab, the focus should go to the treeview.
Any help is highly appreciated.
Thanks in advance for any guidance and suggestion
Regards
Kais
|
|
|
|
|
Hello
In that last control, handle the KeyUp event
private void MyLastControl_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Tab)
MyTreeView.Focus();
}
Regards
|
|
|
|
|
Hi,
When i get data from a device which is attached to my serial port, its cutting it off after like 20 characters.
This is how it would look like:
afsdfagfsdgsdagf
asgdasdfdsafgafa
gasdfasdgadsfsdv
gasdffbzxxcvfads
But i don't want it to cut it off, how can i fix this so it would look like this:
afsdfagfsdgsdagfasgdasdfdsafgafagasdfasdgadsfsdvgasdffbzxxcvfads
Thanks in advance!
|
|
|
|
|
Replace System.Environment.NewLine with an empty string?
string x = stringFromSerialPort;
string modifiedString = x.Replace(Environment.NewLine, "");
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|