|
hi
i add an Unbound DataGridViewCheckBoxColumn to my datagridView for user to select each record that he wants to print (print with DataGridViewPrinter Class), I want to invisible other records that checkbox is False or null,
but at RunTime when i set a checkbox to true and uncheck it again (set to false)
when i want to invisible that record .. the following error shown me :
Row associated with the currency manager's position cannot be made invisible
my code is :
foreach (DataGridViewRow _gridViewRow in dataGridView1.Rows)
{
if (_gridViewRow.Cells[0].Value != null)
{
if (_gridViewRow.Cells[0].Value.ToString() == "True")
{
_gridViewRow.Visible = true;
}
else if (_gridViewRow.Cells[0].Value.ToString() == "False")
{
_gridViewRow.Cells[0].Value = null;
ds_zamin1.Khaneh_1.Rows.RemoveAt(_gridViewRow.Index);
}
}
else
{
_gridViewRow.DataGridView.EndEdit();
_gridViewRow.Visible = false; //Error Occured In this Line
}
}
|
|
|
|
|
You cannot make selected row/cell inviible.
Use...
dataGridView1.CurrentCell = null;
|
|
|
|
|
Try this.
CurrencyManager cm = CurrencyManager)BindingContext[this.DataGridView1.DataSource];
cm.SuspendBinding();
this.DataGridView1.Rows[index].Visible = false;
cm.ResumeBinding();
|
|
|
|
|
thx
|
|
|
|
|
In my c# desktop application i want to change key in my app.config file at runtime.
How can i change this value in runtime?
Actually my need is that i want to store a value somewhere during runtime which i can access next time the i run the program. So this need to be physically written.
Regrads
Hari
-- modified at 11:39 Thursday 23rd November, 2006
|
|
|
|
|
Settings are stored in the config file as properties -Xml elements-. You can access them using the following line
global::ProjectName.Properties.Settings.Default
The class Settings is inherited from global::System.Configuration.ApplicationSettingsBase . Check it in your MSDN or more simply explore it using intellisense.
Regards
|
|
|
|
|
Thanks for the reply. Actually i want to write to the app.config file
|
|
|
|
|
And?? Use the save method in your settings class.
global::ProjectName.Properties.Settings.Default.Properties.Add(new SettingsProperty("MyProperty"));
global::ProjectName.Properties.Settings.Default.Save();
Regards
|
|
|
|
|
Hi Guys,
Im having trouble populating a datagridview that contains DataGridViewComboBoxColumns.
I want to populate the datagrid with de contents of a TList but for some reason it is not working.
The comboboxes are filled with values that match with does that might be in the Tlist and i use the following line to bind the list to the datagrid.
dgTaskPredecessor.DataSource = task.Predecessors;//task.Predecessors is of TList<TTaskPredecessor> type
Can anyone help me?
Tanks
|
|
|
|
|
Hello!
I have a question about the kind of propertygrid that is used in for example http://www.codeproject.com/cs/miscctrl/bending_property.asp[^]
For one of the properties I would want the user to only be able to chose out of the values 512, 1024, 2048, 4096 so that when he clicks this property a list with these values comes up.
I have been able to do this with strings using enums but not with numbers.
Does anyone have an idea how to solve this easily?
Best regards,
Hampus
|
|
|
|
|
Hi guys,
I'm having following situation:
private function DoSomething(){<br />
int x = 6257;<br />
<br />
CheckSomething();<br />
Myclass.UseX(ref x, somethernr1);<br />
Myclass.UseX(ref x, somethernr2);<br />
Myclass.UseX(ref x, somethernr3);<br />
Myclass.UseX(ref x, somethernr4);<br />
...<br />
Myclass.UseX(ref 6257, somethernrN);<br />
}<br />
<br />
Checksomething(){<br />
int x = 7834;<br />
Myclass.UseX(ref x, somethernr1);<br />
...<br />
Myclass.UseX(ref x, somethernrM);<br />
}
Is it possible that after CheckSomething() the x value in DoSomething() has changed?
(PS: There is something that sometimes locks up the application, we can't reproduce it and we're trying to figure out where it is (via logfiles, can't debug).)
Thanks.
|
|
|
|
|
|
My thoughts exactly, but I'm trying all possibilities here .
And what if x was also (3d function) set in another thread? (timer).
|
|
|
|
|
Both x variables are local to their method, so they are unique for each specific method call regardless of which thread is doing the call. Local variables are allocated on the stack, and each thread have it's own stack. Local variables are only accessible by name inside their own method, outside the method they are never accessible by name, only if the method exposes a reference to the variable.
---
b { font-weight: normal; }
|
|
|
|
|
yep, in theory it is, anyway I changed the variable just to be sure, but to tell the truth, it's probably not that. We just don't know what's going wrong... Hope we can find it with some extra logging.
tnx.
|
|
|
|
|
|
lol, I don't smoke
|
|
|
|
|
How to create hyperlink column in datagrid (without asp .net)
io
|
|
|
|
|
DataGridViewLinkColumn
This class will help you in creating hyperlink column in datagrid.
|
|
|
|
|
Hi,
this is probably just a simple question, but I cant figure it out.
I want to change my tabpage font color when it is selected tab. Raised an selectedindexchanged event but cant change tabpage font color.. How can I do this ?? I just to want change font color that as specified in text property of tabPage ...
thanx.
meTin.eRGoktas
|
|
|
|
|
Good day.
I've set-up my SQL 2005 Express server to run on my local machine. What I want to do is develop an application that makes use of an embedded database. What I mean by this is my database must be distributed with each copy of the application. The application is not multi-user and needs to run local machine only, so as I understand it I don't need to intall a server on each client machine to do database handling. Am I right, or must I install the Express server on each client machine?
I would like to use SQL Express as it's easily embedded into Visual Studio 2005 and has a properly working visual interface. Foreign key constrains is a must have(as always). I have great difficulty in finding help on the net with regards to this.
Can someone please help me or explain to me how I can make my database embeddable? Self explanation or website reverences will be greatly appreciated.
Thank you in advance
ASBESTOS-Greetings
LiquidE
|
|
|
|
|
hmm not sure, but it could be the SQL native client is a solution.
When connection using a udl file i can give for "SQL native client" only path and file to acces the SQL 2005 database...
hope it helps..
Greetz
kurt.
|
|
|
|
|
Using SQL Express will require your end-users to install an instance of SQL Express on their machine. Programatically, you access the database the same way you would as if you were developing to a "normal" (full) SQL Server 2005 installation.
If you want a database that is actually embedded (in other words, has a minimal footprint and does not require a separate install) you should look at SQL Server 2005 Everywhere Edition[^] (also called SQL Mobile) which is also a file based database that allows you to scale up to (and integrate with) SQL Server 2005 when necessary.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
How to get Computer's HDD ID,ProcessorID,ProcessorSpeed,MainBoard Model &ID?
Thanks,
K.Alex
|
|
|
|
|
I believe such tasks can't be achieved using a high language as C#. You have to go low level and be a bit hardware specific. Most of your queries -Computer's HDD ID,ProcessorID, MainBoard Model &ID- can be done by reading the system's BIOS using Assembly code. You could also take a look at WMI (Windows Management Instrumentation) in this link[^].
Regards
|
|
|
|