|
What is the exception thrown when another thread tried to access another control which its not given the right to??
Som
|
|
|
|
|
You can check all these yourself easily enough mate...
If you want to find out the exceptions a class throws then visit MSDN and look it up there, or you can simulate the exception and it will tell you the name of it when the program crashes.
Mark.
|
|
|
|
|
hi,
i want to set the column width of DataGrid, but i dunno how to do?
because i'm not using TableStyles
codes :
DataTable DT = new DataTable();
dataGrid1.DataSource = DT;
now, how can i set width of first column ???
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-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Get to the dataGrid1.Columns[i] or dataGrid1.Column["name"] and set its width?
|
|
|
|
|
no, its not so easy, there is no Property named Columns in DataGrid
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-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Urg, now I remember why I always use TableStyles in DG.
|
|
|
|
|
Just do this :dataGridView1.Columns[1].Width=X;",Maybe that's what you'll do.
Always do you best,what you plant you will harvest
later!
modified on Friday, March 21, 2008 4:54 AM
|
|
|
|
|
No, my question is about DataGrid not DataGridView
harry~ wrote: We can't change the first column's width sometimes
hehe, why?? i can change any of DGV
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-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I am so sorry that the DGV we used is defined by our company,you can change any column's width of the .net's DGV.
Always do you best,what you plant you will harvest
later!
|
|
|
|
|
nevermind
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-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
I have to download file and folders from the server folder without using link button.
Regards,
sjs4u
|
|
|
|
|
Okay....and what have you tried to do to accomplish this?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
What is the exception thrown for:
"Object reference not set to an instance of an object." ??
Can someone wirte me a few lines of try catch code or a link which checks whether an array is uninitialised?
Som
|
|
|
|
|
DateTime dt;
int n = dt.Days;
This will throw that error. It means that dt ( in this case ) is null.
Google will tell you all you need to know about arrays. At a guess, you've created an array of objects and are getting this error. Every object in that array is null and you need to call new on it before you can use it.
Christian Graus - Microsoft MVP - C++
"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: At a guess, you've created an array of objects and are getting this error. Every object in that array is null and you need to call new on it before you can use it.
Actually I have a list view items which on runtime remains uninitialized..
And the code is in C++/CLI..
I am asking this here just for the reference..
How to handle it using the try catch blocks?
Is there any other way?
Som
|
|
|
|
|
Hi,
at first use catch(Excemption exc) and watch it, then refine the catch.
Or read the documentation, it is begging for an audience.
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.
|
|
|
|
|
try
{
// code goes here
}
catch (NullReferenceException)
{
// handle error here
}
Mark.
|
|
|
|
|
I have a function which have return type DataRow and the parameters for the fucntion
are the parameters for the stored procedure.
I have to execute the Stored Procedure with given parameters and populate the datarow so that
the return will be the populated DataRow with the output of the stored procedure.
Again I have to retrieve data from the same datarow, perform some calculations in another function
which is going to use above datarow values, and give result in double or int datatype.
I have executed the Stored Procedure and now i m trying to store the data in the datarow
so that I can further retrieve it.
do anybody have idea how to insert and retreive data from DataRow in above case.
Thanks in advance,
|
|
|
|
|
hai,
i am using gridview i get index values by commandName.but how to get index( paticular row) values when i click a image .
if u know the code repaly to me.
|
|
|
|
|
Hi,
The below code throws the error "No overload for 'Test' matches delegate 'System.Threading.ParameterizedThreadStart'"
<br />
AlphaC.Framework.IDebugRoom unitTest = null;<br />
<br />
<br />
unitTest = new AlphaC.Framework.Debug.TestXNAFramework();<br />
<br />
this.testingDelegate = new System.Threading.ParameterizedThreadStart(unitTest.Test);<br />
Note: testingDelegate is a global System.Threading.ParameterizedThreadStart instance, and System.Threading.ParameterizedThreadStart's constructor accepts a 'void (object) target' parameter
But this code works fine:
<br />
AlphaC.Framework.IDebugRoom unitTest = null;<br />
<br />
unitTest = new AlphaC.Framework.Debug.TestXNAFramework();<br />
<br />
this.thread = new System.Threading.Thread(unitTest.Test);<br />
The method System.Threading.Thread() accepts a ParameterizedThreadStart delegate.
I would have thought that public void Test() would match up with void (object) target... I'm wrong obviously... :P
Can anyone point out what I did wrong when I initalized the 'testingDelegate' instance in the first code snippet?
Mark.
|
|
|
|
|
MarkBrock wrote: I would have thought that public void Test() would match up with void (object) target... I'm wrong obviously...
Yeah, obviously. How is a method that takes no parameters, the same as one that does take one ?
You can start a thread with a ThreadStart delegate ( which has no params ) or a ParameterizedThreadStart delegate ( which will take an object ) I'd say the other overload is kicking in in your second snippet.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Yup i've got it now mate,
It was just my ignorance of delegates that was the problem...
Cheers,
Mark.
|
|
|
|
|
NP - glad to help.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi Everyone,
I'm trying to write a graph interface where I have objects that can act manipulated like a graph.
Ok, so I have a graph interface (IGraph) that has a method to return a generic list of interfaces ( List<IVertex> ). However, the class the implements the IGraph interface a list of a concrete class Point ( List<Point> ) which implements IVertex. I can't return it unless if I create a new generic List<IVertex> and do a deep copy.
<br />
public interface IGraph<br />
{<br />
List<IVertex> GetVertices();<br />
}<br />
<br />
public interface IVertex<br />
{<br />
int X { get; set; }<br />
int Y { get; set; }<br />
}<br />
<br />
public class Point : IVertex<br />
{<br />
private int _x;<br />
private int _y;<br />
<br />
}<br />
<br />
public class ConcreteGraph : IGraph<br />
{<br />
private List<Point> _points;<br />
<br />
public ConcreteGraph()<br />
{}<br />
<br />
public List<IVertex> GetVertices()<br />
{<br />
return _points;
}<br />
}<br />
</ivertex></point>
Any one have any ideas? I could do like the following code:
<br />
List<ivertex> list = new List<IVertex>();<br />
foreach (Point p in _points)<br />
{<br />
list.Add((IVertex)p);<br />
}<br />
</ivertex>
But it doesn't seem too efficient. Is there a way of doing this that is more efficient?
Thanks!
dfa_geko
|
|
|
|
|
Instead of:
public List<IVertex> GetVertices()
{
return _points; // Error: Cannot implicitly convert type List to List
}
You could just return List<Point> instead.
Whoever's calling GetVertices can either use Point or IVertex to access the elements depending on their needs.
- S
50 cups of coffee and you know it's on!
|
|
|
|