but for datagridview there is not a property like SelectedIndex
Thanks & Regards
but for datagridview there is not a property like SelectedIndex
Thanks & Regards
Hi Me with C#.net gridview, I am trying to move the selected row to one row up on uparrow keydown and is working fine but after moving the selected row to one row up still the selected row remains with the previous row, How can I make the selected row as the one which I had moved up so that on the next uparrow key press that row will move up my code is private void dgvQuotationEntry_KeyDown(object sender, KeyEventArgs e) { int Asciival = e.KeyValue; string ID , PRDCode int rowIndex = 0, rowCount; rowIndex = dgvQuotationEntry.CurrentCell.RowIndex; rowCount = dgvQuotationEntry.Rows.Count; if (Asciival == 38) { if (dgvQuotationEntry.CurrentCell != null && rowIndex != 0) { ID = dgvQuotationEntry.CurrentRow.Cells[0].Value.ToString(); PRDCode = dgvQuotationEntry.CurrentRow.Cells[1].Value.ToString(); dgvQuotationEntry.Rows.RemoveAt(rowIndex); dgvQuotationEntry.Rows.Insert(--rowIndex, ID , PRDCode); } } }
Thanks & Regards
Hai Me with C#.net I want to make a text box to accept only numbers and decimal points(decimal point only once), so I tried to make a user control and is working fine except one problem. If if select all the data in the text box and try to enter a new value decimal point will not accept until I press the backspace. My user control code is a follows string i; int f; public string Text { get { return NMTextBox.Text; } set { NMTextBox.Text = value; } } private void NMTextBox_KeyPress(object sender, KeyPressEventArgs e) { try { string numaric = NMTextBox.Text; for (int j = 0; j < numaric.Length; j++) { char myChar = numaric[j]; } if (NMTextBox.Text == "") { f = 0; } if (e.KeyChar.ToString() == ".") { ++f; if (f >= 2) { e.Handled = true; } } if (i == "8") { f = 0; for (int j = 0; j < numaric.Length - 1; j++) { if (numaric[j].ToString() == ".") { ++f; } } } if (e.KeyChar.ToString() != "." && Char.IsNumber(e.KeyChar) != true) { if (i != "8") { e.Handled = true; } } } catch (Exception ex) { MessageBox.Show(ex.StackTrace, ex.Message.ToString()); } } private void NMTextBox_KeyDown(object sender, KeyEventArgs e) { i = e.KeyValue.ToString(); }
Thanks & Regards
In my windows form I have a tabcontrol with 3 tabpages. How can I add shotcut key so that while the tabcontrol is loaded I can visit each tab page through the shortcut key
Thanks & Regards
Hi I am with a cheque printing software, how can I print a forms textbox data with out the forms background
Thanks & Regards
modified on Thursday, July 24, 2008 3:39 AM
include //--------------------------------------------------------------------------- using System.Web.Mail; public static string SendMail(int pintUserID, string pstrMailTo, string pstrMailBcc,string pstrMailCc,string pstrMailSubject,string pstrMailBody,string pstrAttachFilePath) { try { MailMessage objMail = new MailMessage(); objMail.From = System.Configuration.ConfigurationSettings.AppSettings["FromEmailID"]; //objMail.From =System.Web.HttpContext.Current.Session["OfficeEmailID"].ToString() ; objMail.To = pstrMailTo; objMail.Bcc = pstrMailBcc; objMail.Cc = pstrMailCc; objMail.Subject = pstrMailSubject; MailAttachment Attachment = null;if (File.Exists(pstrAttachFilePath)) { Attachment = new MailAttachment(pstrAttachFilePath); } objMail.Attachments.Add(Attachment); SmtpMail.SmtpServer = "localhost";//System.Configuration.ConfigurationSettings.AppSettings["SMTPServerIP"]; SmtpMail.Send(objMail);return "TRUE"; } catch(Exception Ex) { return Ex.Message; } } Config file call the function SendMail & enable your system SMTP server.
Thanks & Regards
Hi This link may help you to learn all about report viewer www.gotreportviewer.com
Thanks & Regards
Hai, I am with a InventoryManagement C# windows application, how can I make a setup package for my application which prompts a serial number while installing the setup and also how can I add my icon to the setup project Thanks in advance Anu Palavila
Thanks & Regards
Hi In my C#.net Inventory application in my contact us form I want to place our company website name and when clicked, it must be opened in a web page
Thanks & Regards
modified on Monday, June 30, 2008 7:29 AM
I am with a C#.net Inventory application in one of my form there is a datetimepicker whose value my change according to some selections how can I set the datetimpicker value back to current datetime on a buttion click. I put like datetimepicker1.Text=DateTime.Now.Date.ToString(); but its text is not getting the current datetime Thanks In advance Regarda Anu Palavila
Thanks & Regards
Hai I have a mulit line textbox on each time I enter data into it from another text box it should enter data in a new line in the mulitiline textbox
Thanks & Regards
Hai I have two forms opened in my mdiparent form I want to pass the value from textbox of 1st form to textbox of the 2nd form I cannot create a new instance of the 2nd form since I want to send to the same opened instance, I tried by changing the property to public but cannot be acessed with out creating a new instace pls help me to pass the values to the same opened instance of the form
Thanks & Regards
Hai All, How can we open only one instance of a form at a time from a MDIparent form in C#.net Thanks & Regards
How can we open only one instance of a form at a time from a MDIparent form in C#.net