Forms Data Controls :: Concatenate With "0" Dont Work With A Gridview?
Mar 15, 2011
i have a gridview.one column of this gridview is a number of 13 caracter.(its a concatenation of a value of 7 caracter ,a zero ,4 caracter and the chekcksum value)i have a button to insert a new row in the gridview.when i add the row the field show 12 caracter and not 13 caracter so the ZERO is not shown and not inserted and i dont know why.i tried in another page to concatenate and it works but in the page with gridview it dontthere's my code
In the below code I have data displayed in the webform in a datagrid which has links in it.when I click the link of seperate order or property number they dont work. <asp:Repeater ID="rptClientBooking" runat="server" OnItemDataBound="rptClientBooking_ItemBound"> <ItemTemplate> <tr> [code]....
I have a panel which displays data on selected criteris with the followin columns Confirmationnumber fromdate todate propertynumber now the data which is in the confirmation number is a hyperlink which when clicked should be directed to the page with that particular confirmation number and similarly the property number is a hyperlink which should be directed to that property number page when clicked I dont know how to give the link to it
my query is like this " select product_id, product_price, purchase_amout from purcases"
and on my formview i tried to add a "total purchase"
i tried using <asp:Label ID="total_purchase" runat="server" Text='<%# string.format(cint(eval("product_price")*eval("purchase_amout")),"{ Rp 0:###,###,###,###,###}")%>'>
the total amount show the correct calculation result, but the string format dont work.... so it display 20000 instead of Rp 20,000
btw. "Rp" is the currency symbol in my country... i dont use {0:c} coz the server user US currency
I have a Timer and a GridView who pulls info from the database every X seconds.Every time I query the database the field 'Comments' is replaced with whatever is on the database (since it's bound to it). I'd like to keep my previous value and keep adding into my Label the subsequent values queried from the database.
For instance, first time I query I get a value of "1" in the Gridview. Now someone changes the database row and next time I query it I have a value of "2". Well, I would like to concatenate the last value queried with the previous one and so on.
So at this point the GridView should show "1" and "2". Here is the piece of code I am talking about:
i need to concatenate the gridview rows to a single string if the gridview count is more than 100 then i need to perform the concatenation as 100 comma seperated and the next has to be carried over to the next string say if the count of gridview is 1000 then i need to concatenate the string as string1= 1to 100(Ex: a,b,c....) then string2=101-200 string3= 201-300... and so on. in case if i had to use String builder for this.. tel me how to proceed with this.
I wonder what the right way is to set write permission on a Folder.I am in the properties for the folder I want to set write permissions to. The folder is named "Folder1"Now when I click the "SecurityTab", I can see a listbox there wich grayed out checkboxes for "Allow" and all of these are Checked, then to the right I have unchecked checkboxes for "Deny".I wonder if this is correct now, that "Folder1" has write permissions because this line execute that access is denied to "Folder1" ?
I'm trying to work with HandleError attribute in a MVC2 application and found some weird feature.When you create a new project and choose "ASP NET MVC2 Web Application" (the one that comes with Home and Account suppport) the following code works well:
[Code]....
I believe that is a configuration issue, but I don't kwon how search about.Anyone has an explanation for this?
convert the code below to LINQ, converting my project to a wseb version usimg LINQ To SQL. The project contains 10 textboxes to possibly select from, but I'm only providing the first two textboxes to simplify my question.
mySQL_Statement = "SELECT IDENTIFICATION_DATA.NSC,ITEMISCD.RNC,ITEMISCD.NSC1 FROM IDENTIFICATION_DATA LEFT OUTER JOIN ITEMISCD on IDENTIFICATION_DATA.NIIN = ITEMISCD.NIIN" If Not ((TextBox1.Text = String.Empty) And (TextBox2.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + " where " If Not (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + "IDENTIFICATION_DATA.NSC IN (" + TextBox1.Text & ")" End If If (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + "isnull(IDENTIFICATION_DATA.NIIN) = FALSE" End If If Not (TextBox2.Text = String.Empty) Then If astrixState = 0 Then If Not (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")" ElseIf (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")" MsgBox(mySQL_Statement) End If End If If astrixState = 1 Then If Not (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + " OR IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")" Else mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN IN (" + TextBox2.Text & ")" End If End If If astrixState = 2 Then If Not (TextBox1.Text = String.Empty) Then mySQL_Statement = mySQL_Statement + "AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")" Else mySQL_Statement = mySQL_Statement + " AND IDENTIFICATION_DATA.NIIN NOT IN (" + TextBox2.Text & ")" End If End If End If
i hv a table in ms-access that have a column in datetime format.when i add data to this field it get stored in the format dd/mm/yy with time as 12.00.00 am.i m binding this data in grid view.hw can i remove the time from the date as i dont wanna show time in the that column of grid view. i m binding the data in gridview by the template field binding methods
I am using Ajax ConfirmButtonExtender Control in GridView for Deleting the Record. I am also Exporting the GridData to Excel using Render Method. But when i click on the Export Button, i am getting below error Extender control 'confirmID' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControl
I have been adding different JQuery Carousels to AJAX Tabbed Panels - the first one displayed on the page always works. But any other tabs dont work when I select the tab. I have about a dozen different carousels.
Can anyone recommend one that works in AJAX Tabs or how I can go about rectifying this?
I have a problem with DetailsView linked with Database, DetailsView is Insert/Edit enabled, and adding/ediditng data works, however........ when I add a new record (DetailsView in Insert mode) and press INSET instead going to record I have just created in Read-Only Mode it shows me blank form, it looks that the "linking" field is null.
I have a gridview with several ItemTemplates. The first contains a checkbox the rest contain textboxes. I then added dynamically some bound controls like this:
BoundField bdfPrivName = new BoundField(); clsUtilities.SetBoundFieldCenter(ref bdfPrivName, "PrivName", "Priv Name"); BoundField bdfDescription = new BoundField(); clsUtilities.SetBoundFieldLeft(ref bdfDescription, "PrivDesc", "Description"); BoundField bdfLive = new BoundField(); clsUtilities.SetBoundFieldCenter(ref bdfLive, "Live","Active?"); grdExisting.Columns.Add(bdfPrivName); grdExisting.Columns.Add(bdfDescription); grdExisting.Columns.Add(bdfLive);
I then use FindControl to locate the checkbox and textboxes and perform my logic based the result foreach (GridViewRow gvr in grdMissing.Rows) { mckbAny = (CheckBox)gvr.FindControl("ckbAdd"); mtxtApplyDate = (TextBox)gvr.FindControl("txtAddApplyDate"); mtxtDateToAdd = (TextBox)gvr.FindControl("txtAddDateToAdd"); mtxtDateToRemove = (TextBox)gvr.FindControl("txtAddDateToRemove"); etc.
This all worked fine. I then got a request to put the bound fields as the second, third and fourth columns, after the check box and before the textboxes. I found that this was easy to do by changing the Add's to Inserts as follows: grdExisting.Columns.Insert(1, bdfPrivName); grdExisting.Columns.Insert(2, bdfDescription); grdExisting.Columns.Insert(3, bdfLive); It looked fine of the page, but the FindControls, all of them fail to work.
I'm using the code below to extract data from a gridview and populate it into textboxes for the days and two drop downs for Project and Category.
For some rows in the gridview everything but the category ddl populates correctly. If I click the row a second time the category ddl displays the correct category.
why I have to click twice for some rows? And how do I fix this?
I would like to know if there is a way to debug the gridview and work around the code that is behind it.Right now i'm getting an error when i try to modify a record with this control. So, if any of you guys know a way to get this done,
I have a gridview connected to my objectdatasource, i wrote a class for the database queries.Now when i do an update of record i get the id form the grid, when i click on delete i don't get the id, its 0.Is there an option to set the id? i can't find it in the gridview.
i have been following the asp.net data access tutorials on this site. When i try to update, nothing happens. I believe the problem lies with my wrong coding on the BLL part. I'm using table adapters. Could anyone point out what iswrong with my code or tell my what the correct code is?