|
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!
|
|
|
|
|
Hello everyone,
I am confused about the statement from the book Threading in C# about thread priority,
http://www.albahari.com/threading/
the confusing statement is, "The ideal solution is to have the real-time work and user interface in separate processes". Why the solution works and ideal?
The whole paragraph is,
--------------------
If the real-time application has a user interface, it can be undesirable to elevate the process priority because screen updates will be given excessive CPU time – slowing the entire computer, particularly if the UI is complex. (Although at the time of writing, the Internet telephony program Skype gets away with doing just this, perhaps because its UI is fairly simple). Lowering the main thread’s priority – in conjunction with raising the process’s priority – ensures the real-time thread doesn’t get preempted by screen redraws, but doesn’t prevent the computer from slowing, because the operating system will still allocate excessive CPU to the process as a whole. The ideal solution is to have the real-time work and user interface in separate processes (with different priorities), communicating via Remoting or shared memory. Shared memory requires P/Invoking
the Win32 API (web-search CreateFileMapping and MapViewOfFile).
--------------------
thanks in advance,
George
|
|
|
|
|
It tells you right there in the paragraph...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thanks Paul,
After some thinking, I think it just means that for RT task you want to set process and thread priority to maximum.
If you have a UI thread in the same application - you can lower the thread priority, but process priority will still be high, giving unneded CPU cycles to the UI thread
So best solution will be extract UI to another process that can have independent process and thread priorities so no additional CPU cycles will be wasted on UI tasks.
Understanding correct?
regards,
George
|
|
|
|
|
George_George wrote: you have a UI thread in the same application - you can lower the thread priority
You run the risk of your application being not very responsive. With current multi-core machines, I suspect this really won't be an issue anymore, for the most part.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thanks Paul,
With multi-core H/W, is there any method to assign some thread to run one some CPU (in other words, let the specific CPU serves the specific thread)?
regards,
George
|
|
|
|
|
This google search [^] on thread affinity may answer your question...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|