thanks j
johland
Posts
-
sending data from html table to code behind -
sending data from html table to code behindhi i was wondering what is the best way to send data in my case, from an html table to the code behind.the data of the table is added dynamically and when user press on the submit button i need to get the data in c# code behind. i dont want to use gridview at this case. my thinking was building a string that will hold all of the table data and then using ajax or hidden field to get it in the code behind. is it the best way to do that? is there a way to pass objects from js to code behind? thank u in advance.. j
-
EditIndex after Sorting a gridviewi think that as long you are not in edit mode the editIndex will always will be -1? I've solved it by saving the sorting definitions (the expression and direction) in a Session object and retrieved the data with an "ORDER BY" clause giving it these parameters... thanks j
-
EditIndex after Sorting a gridviewhi i have a manually binded GridView with sorting and editing enabled. my problem is with editing columns after sorting them, as the newEditIndex property in the GridView RowEditing event is a reflection of the data from the db and not the dataview that have been set on the gridview Sorting event, the outcome is that when pressing the edit button on a row after sorting, a different row in getting in to edit mode. if any one know the solution please in light me...:} tnx j
-
getting the value of an asp element with javascriptsorry if i'm missing something or wasn't clear enough : I need the id for an ASP control that within a GridView (as mentioned - nested within asp:TemplateField) so for example if my code is: <asp:TextBox runat="server" ID="txtName">> after rendering the TextBox id will be something like: "ctl00_ContentPlaceHolder1_gridView_ctl12_txtName" thanks
-
getting the value of an asp element with javascriptthanks but please see my reply to Parwej above.. j
-
getting the value of an asp element with javascriptbut how can i predict the control id as ASP elements don't have a predetermined id? (i can't use the 'ID' attribute as opposed to the HTML id attribute)
-
getting the value of an asp element with javascripthi is it possible to get an ASP element with javascript? I'm trying to get the text of an asp textbox (or the value of input type text) that is nested within an ASP TemplateField . thanks in advance j
-
setting the columns width of a gridviewthanks... i will examine all that i can think of j
-
setting the columns width of a gridviewi've looked at the source code and width is appearing as i've set it, i.e. if i'm using: gridView.Columns[4].ItemStyle.Width = Unit.Percentage(30); i'm getting: td style="width:30%;" how do you think setting the width issue can be solved? thanks, J
-
setting the columns width of a gridviewthanks Phil but i've tried that and didnt effect the columns width j
-
setting the columns width of a gridviewhi i have a gridview manually bounded to an accsess db. how can i adjust (in my case reduce) the width of specific columns? i've tried to set the width for the header,footer and item templates but all it did was narrowing an invisible text area - caused the text to wrap down but the size of the column remained the same... help on this will be very appreciated.. thanks j
-
VS debugger stopped workinghi, i'm working on a web site in VS and the debugger has stopped working: when i start the debugging it ignores all breakpoints and continue like it was lunched without debugging... i have also tried to see if it will break on realtime errors and it doesn't- the errors are returning on the webpage (as running without the debugging). i've tested other websites and debugger not working there either. maybe need to mention that when i've restarted the computer and created new website with a test page the debugger returned but as i returned to the other projects (or copied the files to the new website) it stopped and didn't work on the new website and any other new website i build for testing it as well. help with solving this will be very appreciated, thanks,
-
Getting a reference to a control on GridView RowEditing eventthanks. previous comment wasn't relevant... i missed that you've handled RowUpdating event. thanks for your help
modified on Thursday, October 2, 2008 6:56 AM
-
Getting a reference to a control on GridView RowEditing eventThanks Thomas, but the GridViewEditEventArgs does'nt contain a definition for 'Item'..
-
Getting a reference to a control on GridView RowEditing eventhi i'm trying to get a reference to a control on GridView RowEditing event: code behind:
protected void gvChores_RowEditing(object sender, GridViewEditEventArgs e)
{TextBox txtEditMsg = (TextBox)gvChores.Rows[e.NewEditIndex].FindControl("txtEditMsg");}javascript:
<asp:TemplateField HeaderText="Chore">
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtEditMsg" Text='<%# DataBinder.Eval(Container.DataItem,"Chore_contents") %>'/>
</EditItemTemplate>
</asp:TemplateField>i can't get the reference (returns null) can anyone advice what i'm doing wrong and how can i get the reference to the control? thanks in advance
-
showing data on a WebUserControl in DataGrid edit modehi, i have a DataGridView with manually generated columns. i have a template column named "DueDate". for this column i am using a WebUserControl consists on an asp Calendar and a text box that shows the chosen date, for saving the data of the selected date i'm using the Session object. the problem i have is with the EditItemTemplate. i cant manage to get the data i need for showing the target date in the WebUserControl TextBox. i've created a Text property for the control and tried to fill it as follow but it doesn't work:
<EditItemTemplate>
</EditItemTemplate>>also have tried:
<EditItemTemplate>
</EditItemTemplate>>didnt work also anyone can help me on that? thanks in advance j
-
refresh gridview on parent form after modal child form closed [modified]hi i've got a gridview on a parent webform. after closing a child form that was opened in modal mode i want the gridview to be refreshed. now i have tried several things that dont work and i dont know why: 1. tried to use: __doPostBack(buttonName,'') in javascript methode but nothing happened. this is the code i have used: code behind:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;
//btnNewChore:the button that activates the modal dialog
//btnRefresh: the button that shld activate the gridView refreshingbtnNewChore.OnClientClick = "javascript:OpenChild( theURLOfTheChildForm, btnRefresh.ID)";
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
gridViewChores.DataBind();
}Javascript:
function OpenChild(theURLOfTheChildForm,targetButton)
{var winSettings = "center:yes;resizable:no;dialogHeight:300px" var returnValue = window.showModalDialog(URL, "", winSettings ); if (returnValue == null) { window.alert("NO chore was created!"); } else { \_\_doPostBack(btnName,''); }
2.i've also tried to use document.all("btnRefresh").click(); instead of __doPostBack but i've got an error :document.all("... not an object etc... Thank you in advance for your help yohay
modified on Monday, September 22, 2008 9:12 AM
-
Changing DateTime format of a gridview columnDoes it means that I need to manually create custom columns for all columns within the DataSet's table? thanks again for your help yohay
-
Changing DateTime format of a gridview columnHi I have a GridView that initializes when page is load,its data source is a DataSet. One of the columns is in a DateTime type, how can i change its type or alternately its DateTime format. Thanks in advance, Yohay