|
Why not download Reflector and find out for yourself? This is a fantastic tool that is invaluable if you want to find out how things work rather than just accepting that they do.
|
|
|
|
|
looking at one implementation rather than reading the documentation[^]
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc Pattyn wrote: looking at one implementation rather than reading the documentation[^]
More a general hint that there are other options. Sure - read the documentation, but don't accept that it's right - actually research for yourself. After all, the MSDN is well known for its accuracy and consistency.
|
|
|
|
|
Thanks for taking the time to have a look - I didn't find/see a link to this documentation in the msdn documentation on TryParse(), but unfortunately this documentation doesn't answer my initial question. When I get a little time today, I will attempt to follow Mr O'Hanlon's suggestion. (I have avoided Reflector in the past as it seemed a bit scary)
|
|
|
|
|
Neophyte30 wrote: I didn't find/see a link to this documentation
DateTime.TryParse() has an overload that takes a IFormatProvider parameter and puts you
in charge of what is acceptable and what is not.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Everyone must have used Gtalk..
I want to know that when chat messages arrive in gtalk, one animated notification pops up near the system tray..
How to achive that?
Will C# help?
|
|
|
|
|
ptr2void wrote: Everyone must have used Gtalk..
Nope. I haven't.
ptr2void wrote: I want to know that when chat messages arrive in gtalk, one animated notification pops up near the system tray..
I assume that this is implemented by creating a NotifyIcon control. Use a timer that fires periodically, checks to see if there are any messaged and updates the NotifyIcon.Icon property accordingly.
|
|
|
|
|
I'm in need of some assistance i finish creating an DataGridView and it gets DirectoryInfo from the desginated Directory
my code looks as following:
private void ReceivedFiles_InitColumns(ref DataGridView value)<br />
{<br />
value.Columns.Clear();<br />
dgv.AutoGenerateColumns = false;<br />
<br />
DataGridViewTextBoxColumn col = DataGridView_CreateColumn();<br />
col.DataPropertyName = "FullName";<br />
col.Name = "Naam";<br />
col.ReadOnly = true;<br />
value.Columns.Add(col);<br />
<br />
DataGridViewTextBoxColumn col1 = DataGridView_CreateColumn();<br />
col1.DataPropertyName = "extension";<br />
col1.Name = "Extensie";<br />
col1.ReadOnly = true;<br />
value.Columns.Add(col1);<br />
<br />
DataGridViewTextBoxColumn col2 = DataGridView_CreateColumn();<br />
col2.DataPropertyName = "LastAccessTime";<br />
col2.Name = " Laast Gebruikt";<br />
col2.ReadOnly = true;<br />
value.Columns.Add(col2); <br />
}
Tough now i need when i select and item from the DataGridView that i can remove an entry.
i already tryed :
private void btnDel_Click(object sender, EventArgs e)<br />
{<br />
dgv.Rows.Remove(dgv.Rows[dgv.RowCount -1]);<br />
}<br />
but that doenst work because i need IBindingList
if someone know how to get and remove entry function or some advise on how i could change my code so it works i appricate it
Thanks in Advance
Ben
|
|
|
|
|
foreach (DataGridViewRow selectedrow in dgv.SelectedRows)
if (!selectedrow.IsNewRow)
dgv.Rows.Remove(selectedrow);
This will remove all the selected items.
bdiepeveen wrote: dgv.Rows.Remove(dgv.Rows[dgv.RowCount -1]);
I think you're getting an error because you're trying to delete the new row which is the last row.
Eslam Afifi
|
|
|
|
|
Thanks for helping,
I used it and ran an quick test i keep getting the IBindingList error
Is there an way that i can create or connect IBindingList to my DataGridView code?
|
|
|
|
|
You're welcome.
How are you filling the data? Can you provide more information about the exception? If possible, post all code related to this DataGridView.
Eslam Afifi
|
|
|
|
|
Sure,
<br />
private void ReceivedFiles_InitColumns(ref DataGridView value)<br />
{<br />
value.Columns.Clear();<br />
dgv.AutoGenerateColumns = false;<br />
<br />
DataGridViewTextBoxColumn col = DataGridView_CreateColumn();<br />
col.DataPropertyName = "FullName";<br />
col.Name = "Naam";<br />
col.ReadOnly = true;<br />
value.Columns.Add(col);<br />
<br />
DataGridViewTextBoxColumn col1 = DataGridView_CreateColumn();<br />
col1.DataPropertyName = "extension";<br />
col1.Name = "Extensie";<br />
col1.ReadOnly = true;<br />
value.Columns.Add(col1);<br />
<br />
DataGridViewTextBoxColumn col2 = DataGridView_CreateColumn();<br />
col2.DataPropertyName = "LastWriteTime";<br />
col2.Name = " Laast Gebruikt";<br />
col2.ReadOnly = true;<br />
value.Columns.Add(col2);<br />
<br />
}<br />
<br />
private DataGridViewTextBoxColumn DataGridView_CreateColumn()<br />
{<br />
return new DataGridViewTextBoxColumn();<br />
}<br />
<br />
private void btnOntvang_Click(object sender, EventArgs e)<br />
{<br />
ReceivedFiles_InitColumns(ref dgv);<br />
<br />
DirectoryInfo di = new DirectoryInfo(@"C:\Test");<br />
dgv.DataSource = di.GetFiles();<br />
<br />
}<br />
Thats everything releated to the datagridview.
the // parts are what i already tryed but i get the IbindingList Exception
|
|
|
|
|
bdiepeveen wrote: dgv.DataSource = di.GetFiles();
That's where everything goes wrong. You're binding the grid to an array. Arrays do not impliment the IBindingList interface.
You should put your data in a data structure that implement the IBindingList . You should put your data in a DataTable and then use it as the DataSource of the DataGridView .
Eslam Afifi
|
|
|
|
|
hi,
i’m showing report on basis of dropdownlist(Bar/pie) but it shows only 1st time(correct), second time it not show second report,but shows data in 1st report only why ?
plz check my following code & guide me to solve this
ReportViewer1.ProcessingMode = ProcessingMode.Local
If DropChartType.SelectedValue = “Bar” Then
ReportViewer1.LocalReport.ReportPath = “Report1.rdlc”
ElseIf DropChartType.SelectedValue = “Pie” Then
ReportViewer1.LocalReport.ReportPath = “Report2.rdlc”
End If
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(reportDSCab)
ReportViewer1.DataBind()
ReportViewer1.DocumentMapCollapsed = True
ReportViewer1.LocalReport.Refresh()
ReportViewer1.Visible = True
bhushan
|
|
|
|
|
Hello Everyone.
I am creating a custom control. I need to add, amongst its properties, a bunch of lists.
One of those is a list of System.Drawing.Color objects.
I create the property as usual:
<br />
private List<System.Drawing.Color> _Colors = new List<System.Drawing.Color>();<br />
public List<System.Drawing.Color> Colors<br />
{<br />
get { return _Colors; }<br />
set { _Colors = value; }<br />
}
This, however, seems not to get the things done quite right. Actually, I get this error:
<br />
Cannot create an object of type 'System.Collections.Generic.List`1[[System.Drawing.Color, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]' from its string representation '(Collection)' for the 'Colors' property.<br />
Do I need to add something to my code to have this property working?
Thanks in advance - any help would be much appreciated.
Rey9999
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
I think this means you have a control you can serialise, and you can't serialise a list of colors.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you for the quick reply.
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
You are welcome
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
You are getting the error because 'Colors' is a class in .Net Framework. So just rename your property from 'Colors' to something else.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
i need c# source code to extract audio from a avi file & to merge a audio file to a avi file.its very urgent...........
|
|
|
|
|
arshan wrote: its very urgent...........
Another rentacoder job gone wrong ? Tell your client you have no idea how to do the job, and next time, take jobs you know how to do.
Or, read the article I link to in my sig.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
arshan wrote: its very urgent...........
It is? Great, well you wont mind paying for it then. I have a minimum charge of £300, let me know where to send the invoice and as soon as I have cleared funds i'll write you the code.
Not what you were looking for? try here[^]
|
|
|
|
|
Hrmmmm.... I'm much cheaper!! My minimum charge is £250!
|
|
|
|
|
you know what, you take it. Im a bit busy anyway
|
|
|
|
|
Hi,
I make public some controls on the form and I new a class in a windows form and send this (current instance of the form) to that class as parameter of constrauctor.
Now when I want to set the Text property of a lable of form in the class this error appears:
"Cross-thread operation not valid: Control 'lblStatus' accessed from a thread other than the thread it was created on."
How can I do this?
Best wishes
|
|
|
|