|
Hi,
You would actually run your "query" on the DataSet. By that I mean you can filter and sort it.
Here is an example:
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/FilterData.aspx
Reply back if you have more questions!
Justin
|
|
|
|
|
My understanding say that you can't query dataset, but what best you can do is to filter the dataset - datatable to fect the required information and bind it again.
|
|
|
|
|
Try DataTable.Select(string filterExpression9 of the underlying datasource ( in your case: SelectedTable ) and hide the rows in your datagridview which are not in the result set returned by this method. What I would do is, not to modify original datasource which is "SelectedTableName", but execute SelectedTable.Select(....) and store the result in thze Tag value of the DataGrid which is a object value. Then set the datasource to this result set. Afterwards, if you want to see the original(non-filtered) rows, you won't need to retrieve them from the data store again. Hope this helps.
|
|
|
|
|
hi i would like to know if there is a function that can be writen that will execute after the content of the instance is changed in window applciation in c#.net
|
|
|
|
|
|
Hi,
You have to implement observer pattern here I guess...
Regards ,
Nishu
|
|
|
|
|
do you have a sample or can you direct me to a article discribing it pls?
|
|
|
|
|
|
just add an event of Eventhandler<t> which can be found in .Framework 2.0. You can create a structure or class for the T parameter, it is generic as you see. Then, when you create you instance of tzhe object, add an event handler to your Eventhandler<t> event, that's all. You can fire the events in your properties "set accessor" forexample. Hope this helps.
|
|
|
|
|
Hello everyone,
I have a Windows Application which I would like to use a section for displaying information. I am thinking of make it some how it looks like the CNN News Banner which moves from Right 2 Left.
I was wondering is this is possible and it is can someone be kind enough to give me some information on how to get this done?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
what are the uses of outerxml
and also how to use....
|
|
|
|
|
Hamsika rani wrote: what are the uses of outerxml
and also how to use....
I'm not sure what all the uses of OuterXml are but you could use four periods in a paragraph that had four sentences. Does that help?
led mike
|
|
|
|
|
Hamsika rani wrote: what are the uses of outerxml
Return the XML markup that represents the current node and all its child nodes.
Hamsika rani wrote: and also how to use
Well, get an XmlNode instance and access the OuterXml property.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I want to preview html code in my windows form app using the web browser control, without saving the document. I just want to somehow capture the text/code in the textbox, and display it in the browser control.
Anyone know how can I make this happen?
|
|
|
|
|
Set the control's DocumentText property.
/ravi
|
|
|
|
|
Thank you for your reply. However, I'm not sure how to set the control's Document.Text property. Could you offer some guidance?
Thank you.
|
|
|
|
|
WebBrowser _wb = new WebBrowser();
_wb.DocumentText = "<html>Hello, <b>HTML</b>!"; /ravi
|
|
|
|
|
hi ,
How can i use in a DataGrid Cell Only Number , Iuse yhis function for this :
public bool OnlyIsNumeric(string val)
{
try{
int result = 0;
return int.TryParse(val, System.Globalization.NumberStyles.Integer, System.Globalization.NumberFormatInfo.CurrentInfo, out result);
}
catch{ return false;}
}
but Ican not use this in datagrid in DataGrid1_CurrentCellChanged Event :
DataGrid1[DataGrid1.CurrentRowIndex, 2] = "";
thanx
s_mostafa_h
|
|
|
|
|
Hi Mostafa,
Please use this code:
private void dgview_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
dgview.EditingControl.KeyPress += new KeyPressEventHandler(dgviewKeyPress);
}
private void dgviewKeyPress(object sender, KeyPressEventArgs args)
{
if (!char.IsDigit(args.KeyChar))
args.Handled = true;
}
Please let me know if this helps.
Thanks,
Gopal.S
|
|
|
|
|
thanks a lot for ur reply , but If I want to this (only number ) Only in Column 2 ( one of my field is numeric for e.g. SerialNumber ),
in this case How can i do this .
By the way I have DataGrid , Not DataGridView .then this object has not the properties that u wrote .
thanks again
-- modified at 6:58 Monday 7th May, 2007
s_mostafa_h
|
|
|
|
|
Use DataGrid.EndEdit method to validate if the entered value is numeric or not. Have a look at MSDN Library DataGrid.EndEdit where you can find an example code. Hope this helps.
|
|
|
|
|
Hi Mustafa,
Here is the another solution:
namespace Sample
{
public partial class Form1 : Form
{
DataGrid dGird;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
dGird = new DataGrid();
dGird.CurrentCellChanged += new EventHandler(dGridCellChanged);
DataTable dt = new DataTable();
dt.Columns.Add("SNo");
dt.Columns.Add("Name");
dt.Columns.Add("Amount");
dt.Columns.Add("Address");
DataRow drow = dt.NewRow();
drow[0] = "01";
drow[1] = "Gopal";
drow[2] = "100";
drow[3] = "TTL";
dt.Rows.Add(drow);
drow = dt.NewRow();
drow[0] = "02";
drow[1] = "Raja";
drow[2] = "150";
drow[3] = "SSS";
dt.Rows.Add(drow);
dGird.DataSource = dt;
dGird.Size = new Size(400, 400);
this.Controls.Add(dGird);
System.Windows.Forms.Control.ControlCollection ctlCollection = dGird.Controls;
if (dGird.CurrentCell.ColumnNumber == 0)
ctlCollection[2].KeyPress += new KeyPressEventHandler(dgKeyPress);
}
private void dgKeyPress(object sender, KeyPressEventArgs args)
{
if (!char.IsDigit(args.KeyChar) && args.KeyChar!=(char)Keys.Back)
args.Handled = true;
}
private void dGridCellChanged(object sender, EventArgs args)
{
// Control index - 0,1 assigned for scrollbars(default).
System.Windows.Forms.Control.ControlCollection ctlCollection = dGird.Controls;
if (dGird.CurrentCell.ColumnNumber == 0)
ctlCollection[2].KeyPress += new KeyPressEventHandler(dgKeyPress);
else if (dGird.CurrentCell.ColumnNumber == 2)
ctlCollection[4].KeyPress += new KeyPressEventHandler(dgKeyPress);
}
}
}
please let me know if this helps.
Thanks,
Gopal.S
|
|
|
|
|
it's help me , thanks in advance !
Yours ,;)
s_mostafa_h
|
|
|
|
|
Dear all,
Thank you for replying to my earlier post ; it was extremely helpfull. However, I've got another question. I use the following code :
private void treeView1_Click(object sender, System.EventArgs e)<br />
{<br />
TreeNode node = treeView1.SelectedNode;<br />
lblResName.Text = node.ToString();<br />
}
This produces the following output to the text property of the label :
Treenode:text
Is there a way to show only the content of the row in the treenode, without the Treenode: prefix attached to it.
Cheers 
|
|
|
|