我綁定GridView然後打開選定行的詳細視圖的模態PopUp。在DetailsView(或GridView)中渲染數據將SideBySide渲染爲C#中的兩個部分或兩個列#
我的DetailsView如下所示。
<asp:DetailsView ID="DetailsView1" runat="server" CssClass="table table-bordered table-hover"
BackColor="White" ForeColor="Black" FieldHeaderStyle-Wrap="false" FieldHeaderStyle-Font-Bold="true"
FieldHeaderStyle-BackColor="LavenderBlush" FieldHeaderStyle-ForeColor="Black"
BorderStyle="Groove" AutoGenerateRows="False">
<Fields>
<asp:BoundField HeaderText="Date" DataField="Date" />
<asp:BoundField HeaderText="Feeder Name" DataField="Feeder Name" />
<asp:BoundField HeaderText="Meter Serial No" DataField="Meter Serial No" />
<asp:BoundField HeaderText="Time" DataField="Time" Visible="false"/>
<asp:BoundField HeaderText="Class Of Voltage" DataField="Class Of Voltage" />
<asp:BoundField HeaderText="Voltage-R" DataField="Voltage-R" />
<asp:BoundField HeaderText="Voltage-Y" DataField="Voltage-Y" />
<asp:BoundField HeaderText="Voltage-B" DataField="Voltage-B" />
<asp:BoundField HeaderText="Line Current-R" DataField="Line Current-R" />
<asp:BoundField HeaderText="Line Current-Y" DataField="Line Current-Y" />
<asp:BoundField HeaderText="Line Current-B" DataField="Line Current-B" />
<asp:BoundField HeaderText="Neutral Current" DataField="Neutral Current" />
<asp:BoundField HeaderText="Act. Power" DataField="Act. Power" />
<asp:BoundField HeaderText="React. Power" DataField="React. Power" />
<asp:BoundField HeaderText="Act. Power(tot)" DataField="Act. Power(tot)" />
<asp:BoundField HeaderText="App. Power" DataField="App. Power" />
<asp:BoundField HeaderText="PF-R" DataField="PF-R" />
<asp:BoundField HeaderText="PF-Y" DataField="PF-Y" />
<asp:BoundField HeaderText="PF-B" DataField="PF-B" />
<asp:BoundField HeaderText="Avg. PF" DataField="Avg. PF" />
<asp:BoundField HeaderText="Freq." DataField="Freq." />
<asp:BoundField HeaderText="Act. Import" DataField="Act. Import" />
<asp:BoundField HeaderText="Act. Export" DataField="Act. Export" />
<asp:BoundField HeaderText="Act. Import(F)" DataField="Act. Import(F)" />
<asp:BoundField HeaderText="Act. Export(F)" DataField="Act. Export(F)" />
<asp:BoundField HeaderText="Reactive(Q1)" DataField="Reactive(Q1)" />
<asp:BoundField HeaderText="Reactive(Q2)" DataField="Reactive(Q2)" />
<asp:BoundField HeaderText="Reactive(Q3)" DataField="Reactive(Q3)" />
<asp:BoundField HeaderText="Reactive(Q4)" DataField="Reactive(Q4)" />
<asp:BoundField HeaderText="Act. Import" DataField="Act. Import" />
<asp:BoundField HeaderText="App. Export" DataField="App. Export" />
<asp:BoundField HeaderText="Cons. Act. Import" DataField="Cons. Act. Import" />
<asp:BoundField HeaderText="Cons. Act. Export" DataField="Cons. Act. Export" />
<asp:BoundField HeaderText="Act. Import Demand" DataField="Act. Import Demand" />
<asp:BoundField HeaderText="Act. Export Demand" DataField="Act. Export Demand" />
<asp:BoundField HeaderText="Cons. Act. Import(F)" DataField="Cons. Act. Import(F)" />
<asp:BoundField HeaderText="Cons. Act. Export(F)" DataField="Cons. Act. Export(F)" />
<asp:BoundField HeaderText="Cons. Reactive (Q1)" DataField="Cons. Reactive (Q1)" />
<asp:BoundField HeaderText="Cons. Reactive (Q2)" DataField="Cons. Reactive (Q2)" />
<asp:BoundField HeaderText="Cons. Reactive (Q3)" DataField="Cons. Reactive (Q3)" />
<asp:BoundField HeaderText="Cons. Reactive (Q4)" DataField="Cons. Reactive (Q4)" />
<asp:BoundField HeaderText="Cons. App. Import" DataField="Cons. App. Import" />
<asp:BoundField HeaderText="Cons. App. Export" DataField="Cons. App. Export" />
</Fields>
</asp:DetailsView>
這裏在下面如何我的DetailesView呈現數據如下。
問題是由於我的數據是兩個較長DetailedView也很長。 所以我在這裏我想要我如何渲染DetailsView數據SideBySide。
(實施例:
現在我獲得的DetailsView如下
甲
乙
Ç
d
Ë
但我想,以使其如下
1.A 2.B
3.C 4.D
5.E
)
那麼,任何人都可以給我這個想法來渲染DetailsView。
在此先感謝。
您不能以這種方式操作綁定字段。雖然有解決方法,但這會使您的代碼不必要地複雜。爲什麼不在詳細視圖中使用垂直滾動條? – Codeek
還有一件事..是你只是轉換視圖?那就是當你點擊細節時,同一記錄顯示爲兩個字段記錄? – Codeek
是Codeek ..相同的記錄(哪裏(在哪個記錄中)按鈕單擊)我在Details View中看到。而且我已經保持垂直滾動條,但要求如上所述。是否有我可以使用更多列創建我的自定義控件正如我想呈現我的數據。如果是,那麼請只幫助我幾個步驟,我必須做的。 –