|
why sure you could but you will need to create either a view to maintain this or extend the grids functionality for data binding. I would try the first, first.
You will need to create your own tablestyles collection
see this web page
|
|
|
|
|
why sure you could but you will need to create either a view to maintain this or extend the grids functionality for data binding. I would try the first, first.
You will need to create your own tablestyles collection
see this web page
Like, DUDE, it has all the answers man!
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
The error:
The action being performed on this control is being called from the wrong thread. You must marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.
Begin the delegate call:
<br />
private void Form_QueryOperation_Load(object sender, System.EventArgs e)<br />
{<br />
<br />
SampleSyncronized sampSyncObj = new SampleSyncronized();<br />
SampSyncSqrDelegate sampleDelegate = new SampSyncSqrDelegate(sampSyncObj.LoadTreeView);<br />
IAsyncResult aResult = sampleDelegate.BeginInvoke(tvOperation, null, null);<br />
<br />
aResult.AsyncWaitHandle.WaitOne();<br />
<br />
sampleDelegate.EndInvoke(aResult);<br />
<br />
<br />
}<br />
Updating class
<br />
[Synchronization()]<br />
public class SampleSyncronized : ContextBoundObject<br />
{<br />
public void LoadTreeView( System.Windows.Forms.TreeView crossTV )<br />
{<br />
LoadTreeViewNow(crossTV);<br />
}<br />
<br />
private void LoadTreeViewNow(System.Windows.Forms.TreeView tv)<br />
{<br />
<br />
add tree node codew here<br />
how do I catch the current main thread to update the trre view
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
In the LoadTreeView method, your code should call the LoadTreeViewNow method using a delegate and Invoke, in order to ensure the treeview is updated on it's creator's thread.
public delegate void LoadTreeViewHandler(System.Windows.Forms.TreeView tv);
[Synchronization()]
public class SampleSyncronized : ContextBoundObject
{
public void LoadTreeView( System.Windows.Forms.TreeView crossTV )
{
Invoke( new LoadTreeViewHandler(LoadTreeViewNow), new object[] { crossTV } );
}
private void LoadTreeViewNo (System.Windows.Forms.TreeView tv)
{
}
|
|
|
|
|
Hey Furty,
PLEASE HELP!!!!
Furty wrote:
Invoke( new LoadTreeViewHandler(LoadTreeViewNow), new object[] { crossTV } );
What namespace or object does the Invoke statement belong to, it doesn't recognize the command. Is this a reflection method?
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
please help sir
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Is it possible to make query from XML file with sort/filter option with XPath? Like ORDER BY/%LIKE% in sql language.
Mazy
No sig. available now.
|
|
|
|
|
I think it might be possible, check out XPathExpression.AddSort method. I've never used it, so I can be wrong.
- Kannan
|
|
|
|
|
Thanks Kannan, I'll check it.
Mazy
No sig. available now.
|
|
|
|
|
http://www.topxml.com/xsl/articles/xsl_ado/
look for Sorting
Will
|
|
|
|
|
Have a look at this:
public XPathNodeIterator SelectSorted(XmlNode node, XmlNamespaceManager namespacemanager)
{
XPathNavigator nav = node.CreateNavigator();
XPathExpression xpathExpr = nav.Compile("xpath_expression");
xpathExpr.SetContext(namespacemanager);
xpathExpr.AddSort("sort_expression", XmlSortOrder.Ascending, XmlCaseOrder.None, String.Empty, XmlDataType.Text);
return nav.Select(xpathExpr);
}
|
|
|
|
|
Thanks for your reply. How does xpath_expression or sort one look like? Like SQL?
Mazy
No sig. available now.
|
|
|
|
|
The sort expression is: (from MSDN in VS.NET)
An expression representing the sort key. This can be a string or
an XPathExpression object. The result of this expression is converted
to a string, according to the XPath specification, for comparison. In
an XSLT stylesheet, if xsl:sort is used, but no select expression is
specified, then string(.) is used by default. I just use a string with the elementname or atributename I will have it sorted by.
For the XPath expression bit, you should have a look at this quick introduction to XPath[^] from www.w3schools.com[^]
|
|
|
|
|
Hi!
I need to convert the web browser's notation of path with extra unicode characters (ie. "%20") to regular readable string. There are some converters in System.Text, but I've no idea how to use them.
Any ideas?
h.
|
|
|
|
|
System.Web.HttpUtility.UrlDecode("Encoded%20String");
that should do the trick.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
Whenever I declare an array I have to say how big it is... i.e. [7]...
Now, what if I don't know how big it needs to be...? How would I do that?
/\ |_ E X E GG
|
|
|
|
|
Some examples:
int[] i;
i=new int[]{0,1,2,3,4,5};
i=GetArray();
A good tutorial on arrays in C#[^]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thanks for the link.
/\ |_ E X E GG
|
|
|
|
|
here is an example.
using System.Collections;
...
array = new ArrayList();
int[] myArray = array.ToArray(typeof(int));
this example will turn the ArrayList object into an array of int objects, you can change the type of array returned by changing the parameter of the ToArray method.
Another Post by NnamdiOnyeyiri l Website
|
|
|
|
|
|
There are two different ways of interpreting what you write:
1) You know the size of the array at runtime, but not at compile time.
public int [] CreateArray(int size)
{
int [] array = new int[size];
return array;
} The second method is when you don't know ahead of time how many elements you'll need. This typically happens when you are dealing with data being input by the user.
public int[] CreateArray()
{
string input = "";
ArrayList alist = new ArrayList();
Console.WriteLine("Enter a number then press enter, to quit just press enter");
while("" != (input = Console.ReadLine()) )
{
int i;
try
{
i = int.Parse(input);
}
catch
{
Console.WriteLine("\"{0}\" is not a valid input number, try again",
input);
continue;
}
alist.Add(i);
}
return (int[]) alist.ToArray(typeof(int));
} All code has not been compiled so errors my exist
James
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
The second one is what I wanted, thanks.
/\ |_ E X E GG
|
|
|
|
|
I must say once again, Thanks. This nice example you set up for my question really helped me out today.
Good Man.
/\ |_ E X E GG
|
|
|
|
|
I need to embedd a treeview inside each row of a listview. and be able to have row sizes only per row to accomadate the listview.
Does anyone know of any articles on this?
thanks,
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
There's two articles here on CP on exactly this subject, look them up under C# Controls.
|
|
|
|