.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Need help on Select button column in Data Grid to populate fields in Form View

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

 When I have a select a row in a Data Grid that when I click on it I want it to show the info for the person I selected in a form view on the same page as the Data Grid. Here are the columns for the Data Grid that I have set up, the column is highlighted:

<asp:DataGrid ID="MHGrid" AutoGenerateColumns="False"  
        DataSourceID="MHFoundation" DataKeyField="POPULATION_LIST_ID" 
        AllowPaging="True" AllowSorting="True" BorderStyle="Solid" 
        BorderColor="#999999" BorderWidth="3px" CellPadding="4" PageSize="4" 
        CellSpacing="2" runat="server" BackColor="Gray" Font-Bold="False" 
        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
        <SelectedItemStyle BackColor="#FF9900" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
            <asp:ButtonColumn CommandName="Select"  Text="Select"></asp:ButtonColumn>
            <asp:BoundColumn D

View Complete Post

More Related Resource Links

Use Data in a Column as Select Button in GridView

I don't want to use the built in "Select" hyperlink that's in the gridview, I'd like to just use the first data column, is there a way to do that or are we forced to use the automatically generated "Select" column.Thanks!

Is there any way to populate an InfoPath form field with the data from the site content type column?


I have a Form library with a form template.

The templat has a field "Office name" which should not be a fixed list of values, but a dynamical list, feeded from a different type of form. I'm a novice with InfoPath - Sharepoint and I want to find out, how can I can give users a possibility to create and maintain a list of offices and also have this list as a selection list inside main library form - ALL inside one library, if possible.

I assumed that if I publish main form (Itinerary) as a library template form and lookup form (OfficeInfo) as a SiteContent, I should be able somehow to connect to siteContent column and it's information. But I cannot see how - Site Content Gallery is not appering as a Connection item.

Can I use SiteConenct for this purpose or there are other ways to create end-user lookup lists?

Thank you!


How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe


Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,

Kareem Naguib

When User Clicked on Save Button Result Should be visible and Grid View Text Fields should be visibl


Hi Friends,

   I am Ali, My Issue is

1. I have 'Result Management Form', in this form after entering Subject marks(In Grid View), i clicked on Save Button. (Result: When i click on Save Button totlal marks should be visible in Lable)

2. But when  i click on Save Button Subject marks 'Text Fields' are going to empty. and not visibling Total marks in Lable.

Here i am using this code

for (int i = 1; i < st_data.Rows.Count; i++)
int tot = 0;
for (int j = 3; j < st_data.Columns.Count-1; j++)
st[j] = st_data.Rows[i].Cells[j].Text;
tot = tot +int.Parse(st[j]);


Any Ideas



MD.Liakath ali

show data in grid view error Arithmetic operation resulted in an overflow.



i have a table there is 17 columns in 17 column 3 are number and other are varchar . when i try to display all data of that column error occures.

one more intersting think is when i try to display 6 column then grid show there data an no more error occures. 

when i run my project this error occures in grid view

Arithmetic operation resulted in an overflow. 

Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

Send an Email with User fields data entered in the form


Hi All,

          I have a form which have some user input fields(like textboxes,dropdownlists,textarea etc) fields and a submit button.

on click i need to send email with body contents as all the details entered by user in the form

Can anyone suggest how i should approach to this in sharepoint..

any code examples would be appreciated.


Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Use BDC data in list as multi-select column

I have a document library that uses values from another system for its metadata.  Right now, we copy the values from the primary system into SharePoint so users can choose them.  I want to find a way to use the BDC connection that I have set up to automatically pull those values.  The problem is that the current metadata is set to multi-select.  So, I have a file that is in the library and it can be used for multiple clients - clients is a column in my library and users can select many entries.  When I set up a column to pull BDC data, it only allows single entry.  Does anyone have any ideas?

Write select query with a paremetrized where clause, and populate database with the retrieved column

I want to be able to retrieve column values using the dropdownlist values as parameters then populate the tbPO table with the retreived values. Where and how do I do it. ImportsSystem.Data.OleDb ImportsSystem ImportsSystem.IO Imports ?directcostDataSetTableAdapters PartialClass po_header  Inherits System.Web.UI.Page  Dim cn As OleDbConnection  Dim cmd As OleDbCommand  Dim dr As OleDbDataReader  Dim icount As Integer  Dim str As String  Dim vendor_id As Object   ?  Public Sub btn_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.ClickTry   context.Items.Add(     cmd.CommandType = System.Data.   cmd.CommandText = Dim context As HttpContext = HttpContext.Current"Company_Name", DropDownList3.Text)Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Users\Owner\Documents\Visual Studio 2010\WebSites\WebSiteJun25\App_Data\directcost.mdb;")Dim cmd As New OleDbCommand()CommandType.Text"insert into tbPO(ponumber, suppliername, ShipTo, basictype, DateNeeded, Purpose,ShippingInstr, ProjId) values(?,?,?,?,?,?,?,?)" cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.AddWithValue( cmd.Parameters.Add

Hide grid view column if empty

 Hello All, I want to hide a grid view column if that column is empty. How do I do this? I dont have much exp. with grids. Please help me. Thanks in advance.

How to pass page column value to data view parameters

Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  

Disable a link button in grid view after it is clicked

I have a grid view with each row as a link button. When I click on the row, some data parsing process takes place (about a 15 sec process). The grid refreshes itself at a regular interval. I want to disable the link when it is clicked once, so that the user gets to know that row has been processed already and does not click it again, until the grid refreshes itself and the row disappears. I am copying my gridview code below. Please give me some idea on how to disable the link button on that row as soon as it is clicked.Thank You. <td rowspan = "4" valign = "top" > <asp:Label ID="gvOrdersQueueLabel" runat="server" ></asp:Label><br /> <asp:UpdatePanel runat="server" ID="updatePane1"> <ContentTemplate> <asp:GridView ID="gvOrdersQueue" runat="server" OnRowCommand = "ParseOrderMessage" EmptyDataText="No Cases Found" BorderStyle = "Double" AlternatingRowStyle-BackColor="Beige" EnableViewState="false" AutoGenerateColumns="False" HeaderStyle-Height = "20" RowStyle-Height = "20" AllowPaging ="true" PageSize = "20" OnPageIndexChanging="gridView_PageIndexC

Print Form View and expanding text fields?

The form i'm editing has a small text field with a scroll bar that users enter quite a bit of data.  I'm wondering how to create a print view for the form that will expand that field to match the size of the content text. Does that make sense?

XSL Lookup to another List in a View. Joining in data from another List. xsl:value-of select=

I've been able to create a DataView with data joined from two SP Lists. I did this using SPD, a linked Source, and doing joined subviews.  The technique works nicely, but I have to create my DataView from scratch.As an alternative, I took an existing AllItems View in SPD, converted it to XSL, and was able to add a column from another List as follows:   <TD Class="{$IDA1VDGH}" style="width: 62px; height: 23px"><xsl:value-of select="/dsQueryResponse/Master/Rows/Row/@Lastname" />The problem is, it reports the column for the first row everytime. I'm new to XSL and was wondering..    using XSL, and preserving all the original columns already in the View, is there anyway to make the added column smarter, maybe with a filter?I noticed in my working example, I have this filter (I guess where the subview join magic is)            [@Title = $dvt_ParentRow/@Key] which does not resolve syntax:I tried this, but it does not work, only finding one match, and it also seems to get set for the entire Dataview and not just the column.     [../../../Master/Rows/Row/@Title = @Key] I guess I'm looking either for the SPD steps, or XSL code for adding a single column from another list, joined in by a column in both lists.Thanks for any help or information.

how to duplicate fields on form data source?

I have many fields with similar names and same type. Is there any easy to copy and paste and then change field names? thanks,
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend