i'm having an issue using mv3 and entityfirst coding, all my tables are fin except for one table where it keeps adding an extra foreign key column and i dont know why, here is my code:
[Code]....
like i say, all other foreign keys look fine but for some reason in the entries table i have an extra column. i have the 2 expected foregin key columns:
I have a GridView that has several dynamic columns (I do not know how many at design time and it could be 0-12 columns, hence need for dynamic columns). I have the columns in the grid and data bound to them - works great. There are other standard, design-time TemplateField columns with TextBox controls in them. These are bound with values that the user can edit. The grid is posted back via a Submit button. My question is "Why does gv.Columns.Insert() cause all my TextBox data to be null on Postback, but gv.Columns.Add() works like a champ?"
protected void BuildColumns() { // The first column to begin to insert the columns in the GridView int columnIndex = 5; BoundField aoColumn = new BoundField(); aoColumn.HeaderText = "New Column 1"; gvMyGrid.Columns.Insert(columnIndex, aoColumn); // kills txtQuantity.Text on postback gvMyGrid.Columns.Add(aoColumn); // works fine columnIndex++; foreach (MyEntity my in _myEntityCollection) { BoundField myColumn = new BoundField(); myColumn.HeaderText = String.Format("{0:d}", my.StartDate); gvMyGrid.Columns.Insert(columnIndex, myColumn); columnIndex++; } }
I then go on to assign values to these BoundFields in the _RowDataBound method and all of this works great. However, when I post back and try to reference some TextBox and they are all null. And yes, I have the BuildColumns() call wrapped in if (!IsPostBack) on Page_Load. Of course I would like to use .Insert() so that the columns can go in the proper location and not at the end of the Columns array.
I created a gridview that is made up of 4 gridviews and using a stored procedure to populate it. I create columns at runtime because the number of columns changes all the time.To make the grids editable I am adding template fields at runtime as I create the columns, this is to ensure that a user is able to edit the cells and some foot values update. Reason why I have four grids is to freeze rows and columns like in excel using javascript. The problem is that performance is very bad especially in IE, the grids take a long time to load. I am not sure if this is caused by the data load or the creation of text boxes. see some of the code below for my _aspx page:
in asp.net page user able to select gridview Columns, and it will hide remaining columns and that selection done by check box with column list bellow is Image link , what exactly I am looking for [URL] it look bellow after selection of column done [URL]
I've created a new ASP.NET website. I've generated an Entity Data Model from my database and have dropped a entitydatasource and gridview onto my page and wired up the gridview to pull from the entitydatasource. Now I get columns like this: id extension prefix did_flag len ten_id restriction_class_id sfc_id name_display building_id floor room phone_id department_id
In each case where the item is named something_id this reflects a foreign key relationship in the database - and I did choose to have the EDM expose foreign key relationships. I'd like to make it so the gridview pulls in the values for these foreign keys rather than just showing the ID numbers - so, for example, department_id might have a value of "101" right now but it should pull from the department table "Marketing".
I have a datasource, which includes many columns, idealy, I need use a gridview to show:
1) first 3 columns: template fields, these fields depends on values in some columns of datasource. I use template fields, hard coded. works fine.
2) the other columns. This is I do not know how to do it. In the data source, there are about 10-20 columns data, each time, the # of columns of the data varies. idealy, I need show each of them as a seperated column in gridview. The entire data source may have 30 columns, but some of them are used in 1), and I only want show these 10-20 columns in gridview. Some columns in data source, I may not use them at all. is there a way to do this? or have to seperate them as a detail view style UI?
I am developing an web application. One of this form has a textbox. When the user enter chars i need to fetch the records from db and display as 4 columns in AUTOCOMPLETEEXTENDER CONTROL TOOL KIT and it's column name also. When the user click any one of the row, i need to get the 2nd clicked column name and display it in textbox.
how to display 4 columns and it column name in autocompleteextender control?
I am trying to arrange the report parameters in three columns instead of two columns. I have about 13 report parameters . Is there a setting anywhere to be done.
I have a gridview with predefined columns and a selectcommand. Why do I get the columns twice? I want to keep the predefined columns and the selectcommand, but avoid getting the columns double.
I'm creating a table in an asp.net code behind dynamically, and I want to have a footer row that only has 2 cells. The first should span all the columns in the table-1. Is there some way other then keeping track of the # of columns in the table manually for me to set the colspan to be # of all the columns in the table-1? Preferably a HTML or CSS solution?
I've the following code which successfully makes an average for all the columns from a table. What I need to do though is ignore certain columns in this equation.
Dim totalNumber as Double = 0 Dim count as Integer = 0 For x = 0 To xyz123.Tables(0).Columns.Count - 1 Dim current as Double = 0 If Double.TryParse(xyz123.Tables(0).Rows(0)(x).ToString(), current) AndAlso current <> 0 Then count += 1 totalNumber += current End If Next Dim averageRating as Double = totalNumber / count
I apologize for the odd title. I've been trying to figure out how to do this and can't quite put it into words. Basically, I need to try to display a GridView with a whole bunch of columns (37 in one case) in two "rows" of columns. More or less.
So instead of this:
Column1 Column2 Column3 Column4 Column5 Column6 Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data
I'd like something like this:
Column1 Column2 Column3 Data Data Data Data Data Data Data Data Data
Column4 Column5 Column6 Data Data Data Data Data Data Data Data Data
As in the example there can be multiple rows returned which all need to be displayed. I'm trying to stop a very large horizontal scroll bar being required. I've been searching as much as I can but haven't found anything that fits what I'm looking for.
I'm have a page which I sent a parameter through the query string.
If I'm retrieving it with Request.QueryString["Format"] I'm having troubles with the type 'CDDVD'. It's being returned as 'CD\DVD'. It's important I get this as the right string.
How do I avoid the extra backslash? Or even get rid of it later?
I don't know how strong the support of RadControls over here is, but it can't be worse than Telerik(there I'm lucky to get a response in 2-3 days), so I'm going to try here first.
Basically, I'm trying to do custom theming(using just CSS classes) throughout my application, so I tried setting the CSS classes needed on the telerik RadTab controls.
Well, when inspecting it in firebug, it adds an extra like 50 px of padding to each tab, which there seems to be no control over. This is their rendered markup
<li class="rtsLI rtsFirst"> <a href="#" class="rtsLink ui-state-default"> <!--This is the only place where I can put in my own custom CSS class--> <span class="rtsOut"> <span class="rtsIn"> <span class="rtsTxt"> Common Application </span> </span> </span> </a> </li>
Now, I know you can't see the style classes, but according to Firebug, every class prefixed with "rts" has the line padding-left: 9px in the style sheet which would of course explain the extra padding problem. (Why do they need all this nesting anyway?!)
I created a Model to do registration on my Website, and add some validations to it. When the user inputs a data, the data will be checked for validity using ModelState.IsValid. But when I input a correct data, it always be invalid. So I decided to debug my program and found that there are an extra key in my ModelState.
For my model, I have UserName, Email, Password, ConfirmPassword, SecretQuestion and SecretAnswer (6 elements)But when I debug, in ModelState, I found 7 elements, they are UserName, Email, Password, ConfirmPassword, SecretQuestion SecretAnswer and the last one is "".I don't know why there is an extra "" in my ModelState, and I checked that it was the source of my error.
I get the error page.I managed to add one sub menu(example) but there is no way that I can add more. Everything looks ok but for some reason dosent work. That's the whole map:
I receive lists from a web service and then I convert the lists to datatable and then I add the datatables to a dataset and from there I get the xml from the dataset where I can save it into a sql database. But the problem is that the xml has /r/n between all attributes and elements. I dont know how to get this out of the xml. Can this be because of my converter. If so can anyone give me a better way to get multiple lists into a dataset.
It's been a while since I've posted here, but I do have a vexing question. I have an export to Excel that is working just fine with the exception that I have one blank line at the top of my export and one blank line at the bottom of my export. All paging and sorting are turned off at this point, so I'm really not sure where these empty lines are coming from. They appear above the header row and below the last row of data, almost like there's an invisible line that gets created after the data makes it to Excel.