I have Two fileds the names are QtyRec and QtyReq in my table when These two are identical(10=10) then corresponding recrod should not listed in Gridview. Can any one provide solution
Gridview Code is Public Sub retriveDataToDataGrid() Try Dim connectionString As String = "Database=pjt;" & "Data Source=localhost;" & "User Id=root;Password=prasad123" Dim query As String = "Select WONumber,paertno,mfgpart,manufacturer,QtyRec,QtyReq,QtyShort,Duedate,Notes from ilist order by WOnumber" Dim connection As New MySqlConnection(connectionString) Dim da As New MySqlDataAdapter(query, connection) Dim ds As New DataSet() If da.Fill(ds) Then GVIL.DataSource = ds.Tables(0) GVIL.DataBind() End If connection.Close() Catch ex As Exception Console.WriteLine(ex.Message) End Try End Sub
i have gridview and im displaying the employement history of employee.and im providing a hyperlink in empid to open employee page with update mode ..so that user can update the record.i have an issue here.only if the employeeresigned = "N" empid should be hyperlink, if its "Y" it should not be a hyperlink.
I generate dynamic grids based on a count value returned from some DB tables. the code for it goes like this : I give and Id to each grid that is generated.
if (myDataList1.Count >= 1) { for (int i = 0; i < myDataList1.Count; i++) { //retrieving the exact i count from pageload ViewState.Add("newCount", i); //creating the dynamic grid with its corresponding gridview properties. grvDynamic = new GridView(); grvDynamic.ID = "GridView" + (i+3); grvDynamic.AutoGenerateColumns = false; grvDynamic.RowCreated += GridViewRowCreated; grvDynamic.RowDataBound += grvDynamic_RowDataBound; //adding bound field columns to retrieve data from stored proc BoundField metric = new BoundField(); metric.HeaderText = "Goal "; metric.DataField = "metric"; grvDynamic.Columns.Add(metric); BoundField mtd = new BoundField(); mtd.HeaderText = "MTD"; mtd.DataField = "value_MTD"; grvDynamic.Columns.Add(mtd); BoundField goal = new BoundField(); goal.HeaderText = "Tier Level Achieved"; goal.DataField = "value_goal"; goal.HeaderStyle.Width = Unit.Percentage(10); grvDynamic.Columns.Add(goal); BoundField you1 = new BoundField(); you1.HeaderText = "Month End"; you1.DataField = "firstLevel_you"; grvDynamic.Columns.Add(you1); BoundField you2 = new BoundField(); you2.HeaderText = "Month End"; you2.DataField = "secondLevel_you"; grvDynamic.Columns.Add(you2); ButtonField singleClick = new ButtonField(); singleClick.CommandName = "clickHyperlink"; singleClick.Visible = false; grvDynamic.Columns.Add(singleClick); BoundField metricId = new BoundField(); metricId.HeaderText = "Metric Id"; metricId.DataField = "metricID"; metricId.Visible = true; grvDynamic.Columns.Add(metricId); //binding the gridview to data. grvDynamic.DataSource = data; grvDynamic.DataBind(); grvDynamic.Columns[5].Visible = false; } }
protected void grvDynamic_RowDataBound(object sender, GridViewRowEventArgs e) { //this basically gets the metric Id's of rows with the ishyperlink flag set to 'Y'. I need to make these particular cells clickable var isClickable = (from md in myDataList3 where md.IsHyperLinkFlag == 'Y' &&
md.value_MTD != null select md.metricID).ToList(); if (e.Row.RowType == DataControlRowType.DataRow) { // Get reference to button field in the gridview. LinkButton _singleClickButton = (LinkButton)e.Row.Cells[5].Controls[0];
This code works perfectly fine , depending on the ishyperlink flag in the database...specific cells in the grid are made clickable and then redirected to page2.aspx My Issue: I need to capture which specific cell in which specific grid the user has clicked. store some information in sessions based on the cell clicked and use that information in page2.aspx.
I need to have a GridView show up at some precise place on a page. I tried to do this by defining the GridView into a cell of a table. It did not work ... the GridView populates OK, however it shows up under my table.
Is there any way I can make this GridView show up at the right of my table and span the 4 or 5 rows I have in this table?
I have a site which displays data form a MSAccess 2003 database in a DataGrid. For simplicity sake the data is products ie an ID, Name, Description and a value representing the amount in stock.I want to allow the user to update the stock field via the datagrid but not be able to change any of the other fields. Is this possible?
I have a GridView, and I want Column1 to be equal to datatable data (filled by a SqlDataAdapter). Then I have two other fields by the SqlDataAdapter (first name, last name), and I want to have those two fields combined to form Column2. I have a TemplateField for my GridView that combines the first name and last name with Eval()'s, but the GridView places this combined field TemplateField and puts it as the first column.
How can I do this so that TemplateField can go in between fields that are databound?
In this case I'm having, the ItemTemplate for various fields in my DetailsView (2 in my case) does not show up, but when you click the edit button, the EditItemTemplate shows up. I played with it, moving it around. No matter where I put it, one of the fields did not show up.
To get even stranger (and don't ask me how I came up with this), if I put a dummy boundfield BEFORE it, the ItemTemplate shows up. But this is totally absurd.
What would be the best way to handle the following scenario? I have an application where depending on what type of proceeding is selected, only certain input fields should be visible.
There are 33 proceeding types and 14 input fields in total
First case, make one big form with all of the fields and have a dropdown with proceeding type which depending on what is selected, makes certain fields visible?
I have a table in my database called "Profiles". This holds data on Female and Male personal characteristics.On my aspx, I have a formview in edit mode which is binded to an object data source with a GetDataByUserId Select methodwhich retrieves data from the "Profiles" Table via a DAL.The "Profiles" table has some columns which relates to females only and some just males and some are generic to both.See example below
UserId - / of Type GUID GenreId / of Type BOOL. Hip Size (For females) Dress Size ( For Females) ChestSize (For Men ) TrouserSize (For Men) Weight ( For both )
When the User logs in , they go to an update Page which has the Formview in Edit Item Mode and contains drop down Lists whichare binded to the Users Selected Value. The DDL are in turn bound to their related table such as HIP, Dress, Chest, Trouser etc.bjectiveIf a female user logs in I just want to show them the (Hip Size) DDL and DressSizeDDL in the Edit item template of the formview and not the ChestSize DDL or TrouserSize DDL.At present the GetProfileByUserId returns all colums from the tableMy question is how do I do this and just show DDL which are relevant to the Female or Male Only. In some cases the usermay not have selected an item in the previous form so they could also be NULL.Am i on the right path by writing a Select Query that checks to see if the User is Male or Female by checking the Genre column in Profiles first.Do I also need 2 panels, 1 to hide Female DDLS and the other to Hide MaleDDLs subject to logged in user genre.
So i'm currently designing a site ( ) and i've made my skeleton master page.What i've noticed is that the gridview must be cut down a little to fit my 1024x768 design.
Now i have taken a note in the past to look at this but i couldn't find the time so i guess the time is now. What i have problem with is shrinking the columns.If i have a name, say "jack R" and i make a gridview column,say width 15 then the name is included and all is ok.However if i have another name,say "jack the 3rd" then the column will expand to fill the name.So all the grid will expand to the right.I have tried in the past some stuff but it seems that if a value is longer than the column then i expands whatever i do.Also i was surprised to see that only the dates will not expand and go "down" instead of right.At least in the gridview i have.
So the 2 questions.How do i make the gridview columns NOT to expand and if the data needs to show in full then how do i make the data go DOWN and not expand right.I have no problem of the grid expanding downwards but i have a problem of the grid expanding to the right.
I have seen a number of posts on this, but none that quite serve my needs. I have a GridView with template fields. I use postback because when a value is entered in one field a calculation is done to supply the value in another field. I simply loop through all the rows after each postback (there are not many so it is fast). I do not use a select command or button to select a row. After postback I do not know how to return the focus to the row that was being used. I can return the focus to the first row just by using gridview1.focus.
I have 2 pages page1 and page2, page1 has a button and page2 has a multiview with many viewswhat I need is:when I click on the button in page1 I want to go to a specific view in page2 ex: view3
I have a GridView and a linqdatasource. The GridView is editable and when the user clicks to edit a row I want to concatenate two of the fields in the linqdatasource and place it in a single textbox.
My gridview displays fields from a table and allows for edit, delete and insert. I need to add a column with a derived field which will be calculated every time the user is either entering a new row or editing the value of the weight field which is one of the fields of the gridview. This calculation is done in the fly and won't be saved in the database.
in my project admin will create user and insert users data into database user can just view it by his login id.only logedin iser related data will be displayed on his page.
here admin has to fill fields as below for each user and create uid and password for that user and wen user will log in only data related to him will be displayed.
id,name,address,city,salary
userview
name ,address,city,salary of his own not othr persons.