|
Hi Bob,
Thanks for a lot it's working ..
Charan
|
|
|
|
|
Hi, I'm trying to fire an event when a NativeWindow is double-clicked. I am not inheriting from it so i can't use the WndProc . I can of course easily get the Handle. Does anyone know anything in the Windows API which I can use to detect a double click?
Thanks,
Chris
|
|
|
|
|
Hullo People!
there probably is a very easy way to solve this problem....
I am working with the treeview control in .net 2.0 windows forms.
I have two tab pages on a form. the first one has a treeview control and the second one has mostly textboxes.
When i navigate or click the second tab the selected node on the treeview control is no longer highlit although it remains selected (i have set hideselection to false).
How do i get the selected treeview node to be highlit when i navigate back to the first tab.
I have tried setting the treeview1.SelectedNode property...doesnt work!!
Thanks & regards
Romi
modified on Sunday, June 15, 2008 5:56 AM
|
|
|
|
|
hi all,
Please help me.I want to change interface through CSS file of Windows Form(its possible or not) in C#.Net window based application. If you have solution please tell me.If you have a another view for changing interface of multiple forms through any tool or form in the .net2.0.
<div class="ForumMod">modified on Saturday, June 14, 2008 3:19 AM</div>
|
|
|
|
|
You are totally confused here. CSS (Cascading Style Sheets) are ONLY used in web based applications, you CANNOT use them in winforms
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Remove the title bar from the form by setting its FormBorderStyle to "none".
Then create your own title bar from scratch.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
I'm using the web browser control to automate loading a web page, and I need to be able to close any dialogs that it opens up. I'm using the IDocHostShowUI to capture alert and confirm dialogs, but there doesn't seem to be anything to do for prompt dialogs. I'm looking for an approach to do something similar with that dialog, or at least be able to capture when it is created and close it using old school windows methods.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi
DataSet with 14 columns. (Only 1 row).
Form with 14 textboxes.
While initialising, each textbox is bound to the dataset:
txtWhatever.Databindings.Add("Text", dsValues, "TableName.ColumnName");
Each textbox displays the values from the dataset.
Changing the values in a textbox does not change the dataset. According to all documentation, it should.
Why won't it work with me?
I don't want to display the data in a single-row datagridview,
because it doesn't really make sense to the user.
Otherwise, I'll have to use no databinding, and on form load populate each textbox, and update the dataset on loss of focus for each textbox.
Thanks,
Nigel
|
|
|
|
|
Did the value get set back into the value in the dataset after focus left the textbox?
Have you tried with DataSourceUpdateMode set to OnPropertyChanged?
|
|
|
|
|
The dataset has no changes no matter what I try.
And yes, I have tried:
txtName.DataBindings.Add("Text",ds, "UserList.Name",true,DataSourceUpdateMode.OnPropertyChanged);
Made no difference.
I have also tried using a binding source, with breakpoints in the parse and format methods, and both get called, but the dataset remains unchanged.
While experimening, I found that a different dataset that does get updated if I use a datagridview does not get updated if I use a textbox.
|
|
|
|
|
Not sure if it's already solved for you, maybe check if the fields are readonly??
|
|
|
|
|
No, the fields are not read-only.
Because this problem is/was holding my project up, I have resorted to populating the textboxes one-by-one from the dataset, doing validating on the textboxes one-by-one, and then writing the values back to the dataset.
This does set HasChanges to true, and the changes are saved back to the database.
So I can use the table, but not an elegant way to handle things. Especially as the deal includes the source-code.
Maybe a SharpDevelop bug? Searching this forum and MSDN doesn't show anyone else with the problem, but then I imagine not many people use simple-binding to a dataset - mostly I see it where they use textboxes to change values in a gridview. I can get that to work, but then I'd have to use an invisible gridview, which is not really a better solution!!!
Nigel
|
|
|
|
|
You can try wrapping the datarow's column with a class with getter and setter. Remember the implement INotifyPropertyChange on the setter.
Maybe I'll try that tomorrow.
|
|
|
|
|
|
Well, sorry to tell, the databinding works on dataset, at least on mine. The message box will display the changed value:
private void button1_Click(object sender, EventArgs e)
{
string s = "user id=sa;password=PASSWORD;initial catalog=DATABASENAME;data source=SERVERNAME;timeout=90";
IDbConnection con = new System.Data.SqlClient.SqlConnection(s);
IDbCommand cmd = con.CreateCommand();
dataSet = new DataSet();
IDbDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter();
cmd.CommandText = "Select * from Customers";
adapter.SelectCommand = cmd;
adapter.Fill(dataSet);
if (dataSet.Tables[0].Rows.Count > 0)
{
this.textBox1.DataBindings.Add("Text", dataSet, "Table.CompanyName", false, DataSourceUpdateMode.OnPropertyChanged, string.Empty);
propertyGrid1.SelectedObject = dataSet.Tables[0].Rows[0];
}
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(dataSet.Tables[0].Rows[0]["CompanyName"].ToString());
}
|
|
|
|
|
Tried exactly the same bindings settings, but will just not work.
|
|
|
|
|
What database are you using? My example was using SQL 2005.
You aren't using WPF are you?
As for 22 columns, that's not a lot. Write a simple code generator, read from a CSV file and generate the class with the get/set.
|
|
|
|
|
I'll look into it.
Besides, that is stiull a workaround.
The point is, simple binding should work. Even the parse routine gets called when I change a value - it just doesn't update the dataset at the end of parse!!
Nigel
|
|
|
|
|
Have you tried dragging the fields onto your form from Server Explorer? That seems to produce bound textboxes that work, then you can look at taking it further from there.
|
|
|
|
|
Using SharpDevelop, don'y have Server Explorer
|
|
|
|
|
Hi,
I have a DataGridView whose DataSource is BindingList of objects:
this.peerList = new BindingList<PeerInfo>();
this.dataGridView1.AutoGenerateColumns = true;
this.bindingSource = new BindingSource();
this.bindingSource.DataSource = this.peerList;
this.dataGridView1.DataSource = this.bindingSource;
I have found guides online of how to set up this filtering, but they only work if the source is a DataTable.
Is there a way to mimic this behavior on a BindingList?
Thanks,
klk
(Also, sorry for not using code tags, as they made the generics disappear).
madness ? this.isSparta = true : this.isSparta = false;
|
|
|
|
|
i developed an application.. and this application is doing some events on every 1 hr... but i want this application to run when the system starts.. hope u got what i mean. so can anybody help to achieve this..
i referred some sites but i got confused.. any good refernce is also appriciated.. with some introduct idea..
Thanks in advance..
cheers..
|
|
|
|
|
|
i checked that .. but where should i enter that code..
|
|
|
|