Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Suppose I have the following situation:
- I have a GridView, and I have just pushed the "Edit" button, so I have triggered RowEditing event
- I see 2 editable columns: "Date" and "Week"
- "Date" is a datetime type, current WebUi control is Calendar
- "Week" is an int type , current WebUi control is TextBox

My question:
Suppose I select a specific date, and that I have a function that calculates ISO-Week with datetime as input; Is it possible to update the Week textbox after changing SelectedDate in the Calendar control? Remember this is happening inside the current RowEditing index.

All suggestions are gladly welcome!
Posted
Updated 7-Jun-14 11:54am
v2

Thank you so much! Works like a gem! :)

Much love <3
 
Share this answer
 
Try getting the week textbox as below from grid row editor, then setting its value on datetime change event handler :-

On date change event handler you can do like this :

C#
//get the index of the row in edit mode
int index = AuthorsGridView.EditIndex;

// get the row by index from grid
GridViewRow row = AuthorsGridView.Rows[index];

// find the textbox from the row
TextBox txtWeek = (TextBox)row.FindControl("txtWeek");

// Now set the text of textbox as desired



Hope this will be of help to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900