|
Hi everyone....
Can anyone tell me if its possible to autosearch a datagrid if the user starts typing on it ?
For example if the user starts typing in a Code field, the datagrid must go to the first location equal to the character pressed etc. until a code is found. Keypressed property ?? Please need help !
|
|
|
|
|
Are you talking about a winform or asp.net app?
If it's winform, you should be able to subscribe to the keydown (or keyup) event. Look at the args to the event and then set the selected index in your grid to whatever row (and whatever column in the row you're talking about) matches the key.
If it's asp.net, you could hook up a javascript function and try to perhaps set a background color on one of the rows. But that will be quite difficult as you will have to interogate the generated table's cell values (innertext i think) and then set a background color on the row with the matching value.
Another way to go might be to put a text box up above the grid and a button beside it that says something like 'find'. Let them type a text fragment into the box and then use the button's event to search the grid contents.
|
|
|
|
|
Yes im talking about a windows form. I did the textbox and button thing but i want as less buttons as possible. Im trying the keydown event ... but having some trouble with it. The datagrid wants to refresh and get the data from the dataset again but i just want it to scroll down to the letter, letters or word ...
|
|
|
|
|
Probably not exactly what you are looking for but I wrote an article which filters the DataGrid. You can find it here[^].
|
|
|
|
|
Something like that , just without the testboxes and filter only by one field.
Thanks anyway
|
|
|
|
|
Hi, anyone know how to drag and drop pictures onto the picture box?
I wan to drag others different images onto 1 single image. it works just like neoprints thingy, dragging other decorative images to the picture that we took. Thanks.
|
|
|
|
|
Hello Friends,
I am facing some problem in Date Time in c#.
I wrote program like this
string strdt= "06/19/2006"; //mm/dd/yyyy
DateTime dt= Convert.ToDateTime(strdt).ToString("d") ;
When I execute this then I get value in dt like "6/19/2006"
But, Actually I need value in dt "06/19/2006" in this format. I mean to say Zero with Six.
How can I solve this problem?
Any help is appreciated
Thanks,
Rajesh
rajesh
|
|
|
|
|
See this:
Console.WriteLine(DateTime.Now.ToString("d", DateTimeFormatInfo.InvariantInfo));
|
|
|
|
|
If you look at the documentation it states that if the day is a single digit it will be returned as a single digit. I would think it doesn't matter how it is stored internally, but how it is displayed. If you want a day to be displayed with a leading zero, use "dd" in the format string.
Here is the link from the MS help files:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconcustomdatetimeformatstrings.htm
HTH
Gandalf
|
|
|
|
|
use
string[] str=dt.Date.GetDateTimeFormats('d');
Take whatever the format you want from str array
Srini
|
|
|
|
|
I think the ToShortDateString does it automatically.
DateTime date = Convert.ToDateTime(strdt).ToShortDateString();
|
|
|
|
|
DateTime dt = DateTime.Parse(strdt);
Console.WriteLine(dt.ToString("MM/dd/yyyy"));
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
Hi,
Here is the c#.Net code:
TcpClient client = new TcpClient();
client.Connect(clientMc , 9333);
NetworkStream ns = client.GetStream();
Note: clientMc is string storing remote machine name as specified in hostfile.
Problem: If clientMc is localhost, the client is getting connected.
If clientMc is the name of other remote machine, it is not connecting and it is waiting over there.
Could you please suggest me?
Thanks
chintu
-- modified at 8:19 Wednesday 5th July, 2006
|
|
|
|
|
Do you have something listening on that port on the other machine? Are you getting an exception?
|
|
|
|
|
|
How to store sessions in first page in asp.net
and then how to retrieve sessions in the next page.
pl explain with an example
Further what is the differece between :Request.QueryString and Request.Form.explain with an example
how & when to write a cookie? explain with an example
Thank U 4 ur kind support
Arun
-- modified at 6:39 Wednesday 5th July, 2006
|
|
|
|
|
Sounds like you should break out your text book, and see if you can get this information from there. That's why it's called homework.
|
|
|
|
|
hi all,
how will i be sure that everything in buffer is read. nothing to read anymore?
i want to call a function after i read all data in serialport but dont know how i should code for check condition ?
help please,
bye.
|
|
|
|
|
If you know your end char of byte strem to read you can use the following code
<br />
SerialPort SPort = new SerialPort();<br />
char chCarriageReturn = '\n';
string strSerialPortReturnData="";<br />
int inReadchar;<br />
while ((inReadchar = SPort.ReadChar()) != Convert.ToInt16chCarriageReturn)) <br />
{<br />
strSerialPortReturnData += Convert.ToChar(inReadchar);<br />
}<br />
<br />
CallMethod(strSerialPortReturnData);
If you want to read All bytes that are there in the buffer use
SPort.ReadExisting()
Srini
|
|
|
|
|
i am developing an application in which i need to send sms messages from my asp.net application. i have googled a lot but to no avail..
Do anybody know the proper procedure to send an sms from asp.net application.
All responses are appreciated.
I need it urgent..
|
|
|
|
|
|
hi all,
how can i erase entire content of a file with C# ?
want that file as if its newly created ?
thanks, bye.
|
|
|
|
|
Just open it and save it.
StreamWriter s = new StreamWriter("test.txt");
s.Close();
|
|
|
|
|
<br />
File.Create (@"C:\Test.txt"); <br />
<br />
srini
|
|
|
|
|
hi,
I need some help regarding the loader lock exception in .net 2.0... I have a simple code which creates a new thread using threadstart delegate and creates a windows form in the thread and calls the show method of that form... the result is a loaderlock exception saying some unmanaged code is executed in managed area... has any body got something to say which could possibly solve the problem...
Thanks...
Regards,
Waqas.
|
|
|
|