|
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCellAddress.X == 1)
{
TextBox txt = e.Control as TextBox;
txt.AutoCompleteCustomSource = ItemCode;
txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
txt.AutoCompleteSource = AutoCompleteSource.CustomSource;
e.CellStyle.ForeColor = Color.Red;
}
}
i use this cod to assign auto Complete to the text box in data grid
it work well but it work for all text boxes After my text i need to assign for it
ahmed eldeghedy
|
|
|
|
|
Have you tried using the debugger to see what is being passed as the X value ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I Want To Convert ToolStripMenuItem Object To Label....
Such As,
private void ChangeSetting(object sender,EventArgs e)
{
Label L=(Label)sender;
}
but I Cannot Do That. Please Help Me
Thank You All
|
|
|
|
|
You cannot cast ToolStripMenuItem to Label, if you want to get/set the text of the menu item use the Text property.
Regards,
Lev
|
|
|
|
|
i'm trying to do as the title says...
im using a DataTable and add DataRow[] in it and every DR contains a column type of a class i have made. The class have 2 properties, a string and an int. Then i bind that DataTable to DataGridView. Now problem is that its showing the class name with Namespace and it should. But i want it to show that string property in that column.
Its exactly same like ComboBox or ListBox binding.
I tried with DataPropertyName but all columns appear blank
dataGridView.Columns[0].DataPropertyName = "Name";
full code
DataTable tmp_dt = new DataTable();
tmp_dt.Columns.Add("Info", typeof(XYZclass));
DataRow tmp_dr = tmp_dt.NewRow();
tmp_dr["Info"] = new XYZclass("a string Param to set the string in class");
tmp_dt.Rows.Add(tmp_dr);
dataGridView.DataSource = tmp_dt;
dataGridView.Columns[0].DataPropertyName = "Name";
any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
You need to override the ToString() or create an implicit operator string (can't remember which one). Then, your class will correctly display wich ever string you want to be displayed in the datagridview.
|
|
|
|
|
Tony_P wrote: You need to override the ToString()
hmmm...seems to be gonna work...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
removed
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Sunday, December 14, 2008 2:10 AM
|
|
|
|
|
Hi There,
i have problem using reportviewer,
when the values in the dataset are null it will show #Error label instead of blank field.
how can i replace or hide the null value into blank field ?
i tried =iff(fields!fieldName.value=Nothing,"",fieldName.value=Nothing) (on report)
(didn't work)
thanks
Roy
|
|
|
|
|
What on earth does this have to do with C# ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
2 things
1 fieldname.value will have DBNull.value
or
2 in your query use IsNull(fielname,'#Error')
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
But i want to Hide '#Error' Label or put blank field
when the value is DBNull.value,
not to show it?!?
Roy
|
|
|
|
|
Ok so turn it on it's head, in your SQL replace null with ''
If you can't think of that solution yourself then you have a serious problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
this was the first thing that i checked so you're not new to me anything.
your solution is not working,
because the dataset object cannot convert numbers/boolean to string..
it should be exactly as it's in the fields in db.
so please try harder, and think..
|
|
|
|
|
Hi All,
I'm just writing some tests using this framework and I can't figure out how to run a method after the tests have completed. Has anyone done this or know how to set it up?
Thanks,
|
|
|
|
|
I believe that xUnit recommends using Dispose, so your test looks like this:
[TestFixture]
public class MyTestClass : IDisposable
{
public MyTestClass()
{
}
private void DoMyTeardown()
{
}
public void Dispose()
{
DoMyTeardown();
Dispose(true);
}
private bool _disposed = false;
protected void Dispose(bool dispose)
{
if (dispose)
{
if (!_disposed)
{
_disposed = true;
}
}
GC.SuppressFinalize(this);
}
} Then, your calling code does this:
using (MyTestClass test = new MyTestClass())
{
}
|
|
|
|
|
Payment negotiable [not ridiculous price but pays well for work need].
Payment made via Paypal
Get in contact : Lbcorsa05 |at| hotmail |dot| co |dot| uk
input/output, + console graphics
|
|
|
|
|
Sorry, seems you have a slight typo in the URL.
www.rentacoder.com is what you meant to type.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
This site has a job board, you're more than welcome to advertise there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Nomadico wrote: very small program
What metric are you using to define "very small program"?
Nomadico wrote: 75 % complete already
Is that just development? Or does that include testing too? And how are you measuring completeness?
Nomadico wrote: not ridiculous price but pays well for work need
Since you posted this in the C# forum, I'll assume it is a C# program you want written. Also, since your email address is from the UK, I'll assume you are paying UK prices.
Currenlty, the UK average for C# developers on a freelance basis is £37 per hour. Therefore if you "pay well" you will have to beat the average. Are you willing to pay that?
|
|
|
|
|
Colin Angus Mackay wrote: Currenlty, the UK average for C# developers on a freelance basis is £37 per hour. Therefore if you "pay well" you will have to beat the average. Are you willing to pay that?
ROTFL !!!! yeah, he doesn't have money to post a job ad, but he's paying well.
Of course, I know you know this.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Nomadico wrote: Need to 'hire' a programmer
I know what it means to hire someone, but what does it mean to "hire" someone? I don't know if I would want to be "hired"...
Nomadico wrote: 75 % complete already
Which means that about 150% of the work is left... 50% to understand the current code, 50% to remove what's wrong in it, and 50% to complete what left of it...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
<quote>Which means that about 150% of the work is left... 50% to understand the current code, 50% to remove what's wrong in it, and 50% to complete what left of it...
thats right
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Me me 'hire' me. I'm a tart - erm contractor, hire me.
Send me the existing source and the requirement specs and I'll get right to it.
Be prepared to deposit $3000 US for me to asses the requirements (told you I was a tart) and I'll supply an estimate for the completion of the job.
Or - use the job board or rentacoder.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I'm a tart
You slag.
|
|
|
|