I have a gridview
<asp:BoundField DataField="UnusedTicketAmount" HeaderText="UnusedTicketAmount" />
<asp:BoundField DataField="ddlUnusedAmount" HeaderText="ddlUnusedAmount" />
<asp:BoundField DataField="AirlinePenality" HeaderText="AirlinePenality" />
<asp:BoundField DataField="ddlAirlinePenality" HeaderText="ddlAirlinePenality" />
<asp:BoundField DataField="NetRefundProcess" HeaderText="NetRefundProcess" />
<asp:BoundField DataField="ddlNetRefundProcess" HeaderText="ddlNetRefundProcess" />
<asp:BoundField DataField="RefundableCommission" HeaderText="RefundableCommission" />
<asp:BoundField DataField="ddlRefundableCommission" HeaderText="ddlRefundableCommission" />
<asp:BoundField DataField="CouponRefunded" HeaderText="CouponRefunded" />
<asp:BoundField DataField="RefundType" HeaderText="RefundType" />
in this gridview i want to add airlinepenality and ddlairlinepanelity to one column how can i do that thanks in advance
You can create a template field and bind two fields like this.
<asp:TemplateField HeaderText="Airlinepenality" SortExpression="ddlAirlinePenality">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("AirlinePenality")+ " " + Eval("ddlAirlinePenality")%>' ></asp:Label>
</ItemTemplate>
you are using Bound field
, we can merge two columns by TemplateField
only, So better you can merge that two columns in your query
,
try like below...
Query:
SELECT UnusedTicketAmount, ddlUnusedAmount,
cast(1.25 as varchar) + ' ' + cast(172813.99 as varchar) as AirlinePenality,
NetRefundProcess,ddlNetRefundProcess,RefundableCommission
ddlRefundableCommission,CouponRefunded,RefundType
Gridview
<asp:BoundField DataField="UnusedTicketAmount" HeaderText="UnusedTicketAmount" />
<asp:BoundField DataField="ddlUnusedAmount" HeaderText="ddlUnusedAmount" />
<asp:BoundField DataField="AirlinePenality" HeaderText="AirlinePenality" />
<asp:BoundField DataField="NetRefundProcess" HeaderText="NetRefundProcess" />
<asp:BoundField DataField="ddlNetRefundProcess" HeaderText="ddlNetRefundProcess" />
<asp:BoundField DataField="RefundableCommission" HeaderText="RefundableCommission" />
<asp:BoundField DataField="ddlRefundableCommission" HeaderText="ddlRefundableCommission" />
<asp:BoundField DataField="CouponRefunded" HeaderText="CouponRefunded" />
<asp:BoundField DataField="RefundType" HeaderText="RefundType" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With