|
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
|
|
|
|
|
if(InvokeRequired)
{
Invoke(blah)
return;
}
lblStatus.text = "I like Crazy frog";
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
mehrdadc48 wrote: I make public some controls on the form
This is always a bad idea.
mehrdadc48 wrote: send this (current instance of the form) to that class as parameter of constrauctor.
How very ugly
mehrdadc48 wrote: How can I do this?
Use delegates to call a form and tell it to change it's UI elements. You can then either set things up to invoke the UI changes, when in another thread, or if you prefer nasty solutions, you can just turn off the cross thread operations error.
If you read the article I link to in my sig, and pay particular attention to the section on how to google error messages.
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 )
|
|
|
|
|
Christian Graus wrote: you can just turn off the cross thread operations error
I wondered about this.
I've always avaoided doing this, and used delegates, as is is seen as bad programming practice by some.
However if I know(due to the design on the application) that a cross thread call will not cause a conflict is it okay to turn off the error?
You always pass failure on the way to success.
|
|
|
|
|
I'd say that's entirely up to the conscience of the individual. If you're OK with it, then why not ? I've done it, when I ported a C# 1.1 app to 2.0 and found that a progress bar that showed loading progress from another thread was not working and I just needed a quick fix. The code had run fine for a long, long time, and it was the first time I'd seen the error.
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 )
|
|
|
|
|
//Declare Delegate :
private delegate void RefToFunction(string s);
//create an instanse :
RefToFunction handle = new RefToFunction(Function_A);
//Define the function :
private static void Function_A(string s)
{
lblStatus.Text = s;
}
//Invoke The Delegate (From where u need):
string status = "Hello World";
object [] param = { status };
this.Invoke(handle, param );
and thats it all
Have Fun
Never forget it
|
|
|
|
|
Hi,
is there anyway I can get a listview to scroll when either the mouse is scrolled or the scroll bar is dragged?
I have created a custom listview control by overriding WndProc()
-
Roger
|
|
|
|
|
You can handle the mouse wheel scroll event and scroll your listview
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 )
|
|
|
|
|
Chris,Hi there,
I am having troubling with doing that itself. I can find Mouse_Up, Down, Capture click et all, but i need something like a mouse scroll for the listview control. How can i do it?
Would be doubly grateful if you could show me how!
-
Thanking you in advance,
Roger
|
|
|
|
|
Pathetic Logic wrote: Would be doubly grateful if you could show me how!
Hi,
Read This..[^]
Som
|
|
|
|
|
read what? it redirects me to my threads on MSDN!
|
|
|
|
|
As far as I can see, you need to handle the mouse wheel event, then set the scroll position in code, or did I misunderstand the question ?
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 )
|
|
|
|
|
yes. i need to handle and position the scroll bars according to the mouse move
|
|
|
|