AJAX :: Can A Details View In The Modal Pop Up Control Be Style Like A Regular Details View
May 12, 2010
I'm thinking of using a modal pop up control that would have a details view in it. I currently have a details view that uses CSS Friendly control adapters with the CssSelectorClass attribute. Can I use the CSS friendly CssSelectorClass property with a details view in the modal pop up and style it as I'm currently doing with my Details View?
I have a details view that appears when record is selected in a GridView. Can this details view be opened in it's own modal window that would allow me to use the full event model?
I have the following code that I'm trying to get to work in a project. I've stepped into all of it and it executes in the correct order. The correct methods are called. The values that are passes are what they should be. I can't figure out why the modul pop extender doesn't open up with the details view in it though.
I have virtually the same code in another project and it works fine. I've compared the two but can't find the problem with it in this project.
I have a vb.net page that has a editable detailsview. When a user wants to erase the data for a field, they highlight the data, and delete/backspace over it, and click update. However, the original data is still saved. If they are replacing the current data with new data, that works fine and updates/saves correctly. This problem only happens when the current data needs to be removed.
I have a details view control on my web page and would like to set the style of it within my skin file. Specifically the alternating row color, width and height.
I have on a page a gridview that can be filtered with one text box. I set up the gridview to show select and wanted to then connect a details view so that when you selected a row the entire details would show up. When I run it I get this error. Data keys must be specified on GridView 'GridView1' before the selected data keys can be retrieved. Use the DataKeyNames property to specify data keys.
I have a gridview which display when person start n stop the project if same person do muliple projects it save n retrives eaisly i want to do that when i press select in gridview it give me the all about the person means if ali is working on 2 projects so it give me details like ali firsrt project is this time n date this , second project is this how can i do this ?
I'm trying to get a record to show up in a details view as part of a Master Details. I was able to get this to work by setting the visibility to true for the Details View in the Page Load event. I now want the details view to show up when the Select button is clicked in the GridView's template field using the onClick event for the button. I don't seem to be assigning the correct properties to get this to work though. what property I should use with this? I know I have to get it from the GridView and assign it to the details but haven't gotten it to work. this is the GridView:
This details view is in a modal pop up. When the edit button is clicked the details view should go into edit mode with the edit button being switched to not visible and the update button being set to visible. This worked with a non ajax Master/Details. Now though when the edit button is clicked the details view closes, or disappears. I don't have any code to set the visible property of the details view to false. I don't understand why it's disappearing and why the buttons aren't changing the way they should.I also tried this with the OnClick event but the same thing happens.
I have detailsview control with bound fields...some usingĀ Templatefields. I am trying to access values in those fields but i get nulls....i really dont know why..I am proving all my code....
I guess something might be getting messy with the mode changing event... a postback? But if i remove the databinding code, i get an error! why find control returns null??
I have a detail view form consist of five fields my 1st field is jobnumber which is primary key i want to do that when user by mistake enter the duplicate jobnumber error occur that this is already used how can i do this ?
I am trying to use a fileupload, to add rows to my gridview on this page. This page is basically a simple admin panel where I can add data to my database. The file upload is used to grab the path of the file and upload the path to the database not the file. The problem is whenever i run my program pick a file, it uploads fine expect the path shows up as true not as the path. the gridview and details view both use the same sqladapater
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <br /> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem>MSD</asp:ListItem> <asp:ListItem>OPS</asp:ListItem> </asp:DropDownList> <asp:Button ID="Button3" runat="server" Text="Department" /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="New" /> <asp:Button ID="Button4" runat="server" Text="Cancel" /> <br /> <br /> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <center> <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="SqlDataSource1" Height="128px" Width="544px" Visible="False" CellPadding="4" ForeColor="#333333" GridLines="None" OnModeChanged="Button1_Click" > <Fields> <asp:TemplateField HeaderText="Order" SortExpression="Order"> <EditItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Order") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Order") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("Order") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Department" SortExpression="Department"> <EditItemTemplate> <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Department") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="textboxdepartment" runat="server" Text='<%# Bind("Department") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label4" runat="server" Text='<%# Bind("Department") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="DOC_Type" SortExpression="DOC_Type"> <EditItemTemplate> <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("DOC_Type") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="textboxtype" runat="server" Text='<%# Bind("DOC_Type") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label5" runat="server" Text='<%# Bind("DOC_Type") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:TemplateField HeaderText="Revision" SortExpression="Revision"> <EditItemTemplate> <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Revision") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Revision") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="textboxrevision" runat="server" Text='<%# Bind("Revision") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="DOC"> <EditItemTemplate> <asp:TextBox ID="textboxdate" runat="server" Text='<%# Bind("DOC") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:FileUpload ID="FileUploadDOC" runat="server" Width="384px" Enabled='<%# Bind("DOC") %>' /> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("DOC") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Active" SortExpression="Active"> <EditItemTemplate> <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("Active") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("Active") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label7" runat="server" Text='<%# Bind("Active") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Rev_Date" SortExpression="Rev_Date"> <EditItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Rev_Date") %>'></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Rev_Date") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("Rev_Date") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible="False" /> <asp:CommandField ShowInsertButton="True" ShowCancelButton="False" /> </Fields> <FooterStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <CommandRowStyle BackColor="#E2DED6" BorderStyle="None" Font-Bold="True" /> <RowStyle BackColor="#F7F6F3" BorderStyle="None" ForeColor="#333333" /> <FieldHeaderStyle BackColor="#E9ECF1" BorderStyle="None" Font-Bold="True" /> <EmptyDataRowStyle BorderStyle="None" /> <PagerStyle BackColor="#284775" BorderStyle="None" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" /> <InsertRowStyle BorderStyle="None" /> <EditRowStyle BackColor="#999999" BorderStyle="None" /> <AlternatingRowStyle BackColor="White" BorderStyle="None" ForeColor="#284775" /> </asp:DetailsView> <br /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="Order" HeaderText="Order" SortExpression="Order" /> <asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department" /> <asp:BoundField DataField="DOC_Type" HeaderText="DOC_Type" SortExpression="DOC_Type" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:BoundField DataField="Revision" HeaderText="Revision" SortExpression="Revision" /> <asp:BoundField DataField="DOC" HeaderText="DOC" SortExpression="DOC" /> <asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" /> <asp:BoundField DataField="Rev_Date" HeaderText="Rev_Date" SortExpression="Rev_Date" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible="False" /> </Columns> </asp:GridView> <br /> </ContentTemplate> </asp:UpdatePanel> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CABCIntranetConnectionString %>" DeleteCommand="DELETE FROM [sop] WHERE [ID] = @original_ID AND (([Order] = @original_Order) OR ([Order] IS NULL AND @original_Order IS NULL)) AND (([Department] = @original_Department) OR ([Department] IS NULL AND @original_Department IS NULL)) AND (([DOC Type] = @original_DOC_Type) OR ([DOC Type] IS NULL AND @original_DOC_Type IS NULL)) AND (([Title] = @original_Title) OR ([Title] IS NULL AND @original_Title IS NULL)) AND (([Revision] = @original_Revision) OR ([Revision] IS NULL AND @original_Revision IS NULL)) AND (([DOC] = @original_DOC) OR ([DOC] IS NULL AND @original_DOC IS NULL)) AND (([Rev Date] = @original_Rev_Date) OR ([Rev Date] IS NULL AND @original_Rev_Date IS NULL)) AND (([Active] = @original_Active) OR ([Active] IS NULL AND @original_Active IS NULL))" InsertCommand="INSERT INTO [sop] ([Order], [Department], [DOC Type], [Title], [Revision], [DOC], [Rev Date], [Active]) VALUES (@Order, @Department, @DOC_Type, @Title, @Revision, @DOC, @Rev_Date, @Active)" SelectCommand="SELECT [Order], [Department], [DOC Type] AS DOC_Type, [Title], [Revision], [DOC], [Rev Date] AS Rev_Date, [Active], [ID] FROM [sop] WHERE ([Department] = @Department) ORDER BY [Order]" UpdateCommand="UPDATE [sop] SET [Order] = @Order, [Department] = @Department, [DOC Type] = @DOC_Type, [Title] = @Title, [Revision] = @Revision, [DOC] = @DOC, [Rev Date] = @Rev_Date, [Active] = @Active WHERE [ID] = @original_ID AND (([Order] = @original_Order) OR ([Order] IS NULL AND @original_Order IS NULL)) AND (([Department] = @original_Department) OR ([Department] IS NULL AND @original_Department IS NULL)) AND (([DOC Type] = @original_DOC_Type) OR ([DOC Type] IS NULL AND @original_DOC_Type IS NULL)) AND (([Title] = @original_Title) OR ([Title] IS NULL AND @original_Title IS NULL)) AND (([Revision] = @original_Revision) OR ([Revision] IS NULL AND @original_Revision IS NULL)) AND (([DOC] = @original_DOC) OR ([DOC] IS NULL AND @original_DOC IS NULL)) AND (([Rev Date] = @original_Rev_Date) OR ([Rev Date] IS NULL AND @original_Rev_Date IS NULL)) AND (([Active] = @original_Active) OR ([Active] IS NULL AND @original_Active IS NULL))" ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}"> <DeleteParameters> <asp:Parameter Name="original_ID" Type="Int32" /> <asp:Parameter Name="original_Order" Type="Int32" /> <asp:Parameter Name="original_Department" Type="String" /> <asp:Parameter Name="original_DOC_Type" Type="String" /> <asp:Parameter Name="original_Title" Type="String" /> <asp:Parameter Name="original_Revision" Type="Int32" /> <asp:Parameter Name="original_DOC" Type="String" /> <asp:Parameter Name="original_Rev_Date" Type="String" /> <asp:Parameter Name="original_Active" Type="String" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="Order" Type="Int32" /> <asp:Parameter Name="Department" Type="String" /> <asp:Parameter Name="DOC_Type" Type="String" /> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Revision" Type="Int32" /> <asp:Parameter Name="DOC" Type="String" /> <asp:Parameter Name="Rev_Date" Type="String" /> <asp:Parameter Name="Active" Type="String" /> <asp:Parameter Name="original_ID" Type="Int32" /> <asp:Parameter Name="original_Order" Type="Int32" /> <asp:Parameter Name="original_Department" Type="String" /> <asp:Parameter Name="original_DOC_Type" Type="String" /> <asp:Parameter Name="original_Title" Type="String" /> <asp:Parameter Name="original_Revision" Type="Int32" /> <asp:Parameter Name="original_DOC" Type="String" /> <asp:Parameter Name="original_Rev_Date" Type="String" /> <asp:Parameter Name="original_Active" Type="String" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="Order" Type="Int32" /> <asp:Parameter Name="Department" Type="String" /> <asp:Parameter Name="DOC_Type" Type="String" /> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="Revision" Type="Int32" /> <asp:Parameter Name="DOC" Type="String" /> <asp:Parameter Name="Rev_Date" Type="String" /> <asp:Parameter Name="Active" Type="String" /> </InsertParameters> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" DefaultValue="MSD" Name="Department" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource> </div> </form> </body> </html> Imports System.Data.Sql Imports System.Data.SqlClient Imports System.Data Partial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click DetailsView1.Visible = True DetailsView1.ChangeMode(DetailsViewMode.Insert) Dim tbox As TextBox = TryCast(DetailsView1.FindControl("textbox1"), TextBox) tbox.Text = DateTime.Now.ToShortDateString() Dim tbox1 As TextBox = TryCast(DetailsView1.FindControl("textboxdepartment"), TextBox) tbox1.Text = DropDownList1.SelectedItem.Text Dim tbox2 As TextBox = TryCast(DetailsView1.FindControl("textbox6"), TextBox) tbox2.Text = "True" Dim tbox3 As TextBox = TryCast(DetailsView1.FindControl("textboxtype"), TextBox) tbox3.Text = "S.O.P" Dim tbox4 As TextBox = TryCast(DetailsView1.FindControl("textbox5"), TextBox) tbox4.Text = "1" Dim tbox5 As TextBox = TryCast(DetailsView1.FindControl("textbox2"), TextBox) tbox5.Text = GridView1.Rows.Count + 1 End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click UpdatePanel1.Update() End Sub Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click DetailsView1.Visible = False End Sub End Class
How would i create a details view that also contains a list?
My aim is to have a details view that displays information about a person and then have a list on the same page that displays facts about that person.
Currently, my details view is working fine. I just need to add the list part. The details view inherits Models.MyViewModel which is a custom class as the details come from multiple tables.
I have created two tables movie with this columns:[mid], [Mname], [Director], [Genre], [Stars], [Description], [Foto] and table rates with columns: rid, Rate, fkmid. This are in relationship one to many, i added one details view and selected Enabel Inserting because i want to insert in this two tables. Because it is not possible to insert in both tables at the same time i created one view selecting all of the columns from both tables and connected SQLDataSource with this view but still i can't insert data from the Details view to the tables movie and rates because there is relationship between this two tables, i get the following error:
View or function 'ViewRM' is not updatable because the modification affects multiple base tables. Does somebody knows how can i insert data from details view to those two tables?
I am trying to implement paging in my detials view which is bound to a data table created at run time from a .txt file the user uploads
when i run the program and click page 2 this is the error i have gotten
'DetailsView1' fired event PageIndexChanging which wasn't handled
I cant seem to determine how to correctly implement this. From what i am reading I thought I could just bind the Details View to the table, which is what i do in my code-behind since it created at run time
In my gridview i click the select button next to a row of data and it pops up a detailsview of that selected row. Also i created button in the details view that closes it. And below is the source code inside the detailsview for how i did that and also the code behind. Since i created it this way where i set the detailsview1.visible = false, when it closes it doesn't pop back up when i click the select button again, and that's exactly what i want it to do is pop up when i click the select button on the gridview.
<asp:TemplateField HeaderText="QuickDetails" HeaderStyle-ForeColor="White" ItemStyle-HorizontalAlign="Right" HeaderStyle-BackColor="#5D7B9D"> <ItemTemplate> <asp:Button ID="btnClose" runat="server" Text="X" OnClick="CloseDetailsView" /> </ItemTemplate> </asp:TemplateField> Protected Sub CloseDetailsView(ByVal sender As Object, ByVal e As EventArgs) DetailsView1.Visible = False End Sub
Over the last couple of weeks, i've been playing around with expression web to try and update our current company website: [URL]
Basically, our site is quite simple. We have individual product categories that are displayed and then the user can click through to view the individual product specification and pictures of said product.
I've created the category pages and inserted hyperlink fields to link to the individual product pages which works fine.
The problem i'm having is getting the specification and pictures to display on the product pages.
I'm literally tearing my hair out as i'm quite new to this.
The access database i'm using has the following fields, ProductID, CategoryID, Description, Comments (This is the Specification field) and then Image1, Image2, Image3 etc all the way up to image 10.
What i've been trying to do is to use an imagefield within a gridview to pull the Image name from the image fields and then display said images from the images folder. I have got this to work of a fashion, yet all the images are displaying instead of the particular product images only. I believe i need to add a query string to do this yet i'm totally at a loss as to how to set this up...
I'm also having the same problem with the specification (comments field) as i can't figure out how to only display the individual product spec..
I have a detailsview which has two ajax toolkit text editors and can take several seconds to load. I would like to display a spinner graphic while the detailsview is loading as it can also reload if the values of a dropdownlist inside the detailsview are changed. I had it working using an update panel and updatePanelAnimation but the problem is that the form has a file upload and it won't post the image from inside an update panel. I have the spinner inside a div element and I've been trying Page.Init, Page.LoadComplete and the like to try to display the spinner while the page is loading and hide it when the page has loaded. Can I somehow hook these up to the detailsview to display a spinner while it's loading?I'm also having a similar problem with a page of FileUploads. I would like to display a loading graphic while files are uploading but it's using FTP to upload the files and I can't find any way to do this.
I am trying to build a program that will have 3 DetailsView side by side but I want to have an empty textbox next to each field....
I cant seem to be able to get a column in between and I don't see a way to add a column to the detailsView only a field
Here is what I want it to look like
DetailsView:
Field Name Value I want to add Color Red MyTextBox
My program is reading a textfile from the users computer using text field parser and creating a data table then I am using the details view to display that data vertically rather then horizontally.
I have a details view that's part of a master/details scenario. When a record is selected it shows the details view. The Pay Status field is a label at this point, when the details view is in read only mode. But then when the edit button is clicked the Pay Status is a DDL that has it's items list populated declaratively.
I want the DDL to default to the text value of the label. This will be hourly or salary. This way if the user doesn't change it's value it will push the correct value to the db.
I tried something with the PreRender event but couldn't get it to work out. Below is what i have so far I wasn't sure how to assign the text property of the label or bind to the label to get the value and set that for the DataTextField.
.NET newbie. I know there has to be a way to do this.I have a details view with it's default mode set to Insert. This is to be used as a form for users to enter records into a database. For two of the fields, I want to pre-populate the field with information. Specifically, I have a vb script with a few functions to query Active Directory to return the user's name based upon their user id. This script works fine.I call the functions for the user name like this:
When the page loads, this populates the text boxes with the user id and the user name.But when the form is submitted, the values in the text boxes are not inserted in to the database.How can I set default values for the fields when the values come from functions?
I have on one page a grid view that has a a delete bit and create new form, these both work. when the user clicks the edit button/link the id for that field is thrown in the url to a new page with a details view on with its default mode to "Edit". I have a stored procedure to update the SQL dB which works when run in SQL. however when the values are chaged in the details view, I click the update button and it says that it has succesfully updated and throws no errors... It has not?
I think the problem is getting the new values out of the details view. which i have been doing like this...
This gives me what the value that it was before editing and the same as in the dB, this is why i'm getting a successful bool value for the stored procedure. My question is this... how do i get the values after its been changed in the details view?