Gridview Button problem
-
Hi to all, I am stucked in a problem. I have a gridview in which there are two button columns. On button click I want image to open in fax viewer. I tried like this. But the problem is that the foreach is going through all the rows. I want that if a user clicks on a certain button then it should open the corresponding image. Please assist me...
<asp:GridView ID="GridView1" runat="server" BackColor="White" DataKeyNames="UniqueID" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False"> <RowStyle ForeColor="#000000" /> <FooterStyle BackColor="White" ForeColor="#000066" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> <Columns> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="SrNo" InsertVisible="False" SortExpression="SrNo"> <ItemTemplate> <asp:Label ID="SrNoLabel" runat="server" Text='<%# Bind("SrNo") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="UniqueID" InsertVisible="False" SortExpression="UniqueID"> <ItemTemplate> <asp:Label ID="UniqueIDLabel" runat="server" Text='<%# Bind("UniqueID") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="BridgeNo" InsertVisible="False" SortExpression="BridgeNo"> <ItemTemplate> <asp:Label ID="BridgeNoLabel" runat="server" Text='<%# Bind("BridgeNo") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Left" HeaderText="PlanNo" InsertVisible="False" SortExpression="PlanNo"> <ItemTemplate>
-
Hi to all, I am stucked in a problem. I have a gridview in which there are two button columns. On button click I want image to open in fax viewer. I tried like this. But the problem is that the foreach is going through all the rows. I want that if a user clicks on a certain button then it should open the corresponding image. Please assist me...
<asp:GridView ID="GridView1" runat="server" BackColor="White" DataKeyNames="UniqueID" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False"> <RowStyle ForeColor="#000000" /> <FooterStyle BackColor="White" ForeColor="#000066" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> <Columns> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="SrNo" InsertVisible="False" SortExpression="SrNo"> <ItemTemplate> <asp:Label ID="SrNoLabel" runat="server" Text='<%# Bind("SrNo") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="UniqueID" InsertVisible="False" SortExpression="UniqueID"> <ItemTemplate> <asp:Label ID="UniqueIDLabel" runat="server" Text='<%# Bind("UniqueID") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" HeaderText="BridgeNo" InsertVisible="False" SortExpression="BridgeNo"> <ItemTemplate> <asp:Label ID="BridgeNoLabel" runat="server" Text='<%# Bind("BridgeNo") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="50px"></HeaderStyle> </asp:TemplateField> <asp:TemplateField HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Left" HeaderText="PlanNo" InsertVisible="False" SortExpression="PlanNo"> <ItemTemplate>
System.Diagnostics.Process.Start(final_text); will act as Start -->Run--> prompt I am Not Sure This Will Work Or Not But Try It
Process.Start("UrPictureViewerExePathToInvoke" + imagePath)
in my system UrPictureViewerExePathToInvoke= rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen Convert the code in C# and Do it
modified on Friday, September 4, 2009 8:30 AM