Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Moving an Icon in a LargeIcon Listview Pin
goldoche6-Mar-07 6:48
goldoche6-Mar-07 6:48 
QuestionRefreshPropertiesAttribute Pin
mihksoft6-Mar-07 3:30
mihksoft6-Mar-07 3:30 
QuestionHow can i make .. Pin
Ahmed EL Gendy6-Mar-07 3:26
Ahmed EL Gendy6-Mar-07 3:26 
AnswerRe: How can i make .. Pin
Guffa6-Mar-07 3:36
Guffa6-Mar-07 3:36 
AnswerRe: How can i make .. Pin
Ennis Ray Lynch, Jr.6-Mar-07 11:56
Ennis Ray Lynch, Jr.6-Mar-07 11:56 
QuestionWINDOWPLACEMENT structure in .Net Pin
manustone6-Mar-07 3:21
manustone6-Mar-07 3:21 
AnswerRe: WINDOWPLACEMENT structure in .Net Pin
Martin#6-Mar-07 3:38
Martin#6-Mar-07 3:38 
QuestionEditing Datagrid Pin
Member 38935606-Mar-07 3:00
Member 38935606-Mar-07 3:00 
Hey there,
I am trying to edit a datagrid. Whenever I click the edit button the grid enters edit mode. But when I change the text in the textbox and click the update(link button) the textbox always goes back to the previous text that was in it.
How do I extract the text from the textbox in the datagrid without losing my change.
below is my code for the update process:

public void Update_dgMilage(object sender, DataGridCommandEventArgs e)
{
TextBox StartMiles = new TextBox();
TextBox EndMiles = new TextBox();
TextBox PersonalMiles = new TextBox();
TextBox BusinessMiles = new TextBox();
TextBox TotalMiles = new TextBox();

StartMiles = (TextBox)e.Item.Cells[3].FindControl("txtStartMiles");
EndMiles = (TextBox)e.Item.Cells[4].FindControl("txtEndMiles");
PersonalMiles = (TextBox)e.Item.Cells[6].FindControl("txtPersonalMiles");
BusinessMiles = (TextBox)e.Item.Cells[7].FindControl("txtBusinessMiles");
TotalMiles = (TextBox)e.Item.Cells[8].FindControl("txtTotalMiles");


string connectionString = ConfigurationSettings.AppSettings["connectionString1"];
OracleConnection con = new OracleConnection(connectionString);
con.Open();

string SQLText = @"update appl_support.HSC_LEASED_CAR_MILES set RPE_MILE_START = '" + StartMiles.Text.ToString() + "', RPE_MILE_END = '" + EndMiles.Text.ToString() + "', PERSONAL_MILES = '" + PersonalMiles.Text.ToString() + "', BUSINESS_MILES = '" + BusinessMiles.Text.ToString() + "', TOTAL_MILES = '" + TotalMiles.Text.ToString() + "' where LCM_PKEY = '" + e.Item.Cells[1].Text.ToString() + "'"; //e.Item.Cells[1].Text.ToString()

// assign query and execute
OracleCommand cmd = new OracleCommand(SQLText,con);

cmd.ExecuteNonQuery();

con.Close();
con.Dispose();

//gets datagrid out of edit mode

dgMilage.EditItemIndex = -1;

getLeaseMilage();

}



Please Help anyone

AnswerRe: Editing Datagrid Pin
Vasudevan Deepak Kumar6-Mar-07 9:14
Vasudevan Deepak Kumar6-Mar-07 9:14 
QuestionConvert text retrived from mail body to tiff file Pin
rsgdba6-Mar-07 2:59
rsgdba6-Mar-07 2:59 
AnswerRe: Convert text retrived from mail body to tiff file Pin
m@u6-Mar-07 3:30
m@u6-Mar-07 3:30 
Questionbooks for c# Pin
Bala subramanyam M6-Mar-07 1:52
Bala subramanyam M6-Mar-07 1:52 
AnswerRe: books for c# Pin
Frank Kerrigan6-Mar-07 2:01
Frank Kerrigan6-Mar-07 2:01 
AnswerRe: books for c# Pin
Vasudevan Deepak Kumar6-Mar-07 7:57
Vasudevan Deepak Kumar6-Mar-07 7:57 
AnswerRe: books for c# Pin
Keshav V. Kamat6-Mar-07 18:26
Keshav V. Kamat6-Mar-07 18:26 
AnswerRe: books for c# Pin
Keshav V. Kamat6-Mar-07 18:29
Keshav V. Kamat6-Mar-07 18:29 
AnswerRe: books for c# Pin
Keshav V. Kamat6-Mar-07 18:34
Keshav V. Kamat6-Mar-07 18:34 
QuestionColor problem C# WinCE VS2003 Pin
trab0076-Mar-07 1:33
trab0076-Mar-07 1:33 
AnswerRe: Color problem C# WinCE VS2003 Pin
Frank Kerrigan6-Mar-07 2:02
Frank Kerrigan6-Mar-07 2:02 
Questiondsn Pin
vijayashanthi6-Mar-07 1:30
vijayashanthi6-Mar-07 1:30 
AnswerRe: dsn Pin
Frank Kerrigan6-Mar-07 2:04
Frank Kerrigan6-Mar-07 2:04 
AnswerRe: dsn Pin
Vasudevan Deepak Kumar6-Mar-07 7:57
Vasudevan Deepak Kumar6-Mar-07 7:57 
Questionhy Pin
mihksoft6-Mar-07 1:28
mihksoft6-Mar-07 1:28 
AnswerRe: hy Pin
Frank Kerrigan6-Mar-07 2:06
Frank Kerrigan6-Mar-07 2:06 
GeneralRe: hy Pin
mihksoft6-Mar-07 2:11
mihksoft6-Mar-07 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.