
r00tsecurity
Top achievements
Rank 1
r00tsecurity
asked on 07 Apr 2009, 10:40 AM
Hi all,
I wanna learn if it's possible to bind 2 database fields into 1 bound column ?
forexample I wanna bind QUANTITY,SELECTED_UNIT fields to 1 column..
<telerik:GridBoundColumn DataField='QUANTITY + SELECTED_UNIT' >
thanx in advance for solutions
9 Answers, 1 is accepted
0
Accepted

Princy
Top achievements
Rank 2
answered on 07 Apr 2009, 10:57 AM
Hello,
A suggestion is to use a CalculatedColumn as shown below with which you casn combine two database fields:
aspx:
Thanks
Princy.
A suggestion is to use a CalculatedColumn as shown below with which you casn combine two database fields:
aspx:
<telerik:GridCalculatedColumn DataFields="QUANTITY, SELECTED_UNIT" Expression="{0}+{1}"></telerik:GridCalculatedColumn> |
Thanks
Princy.
0

r00tsecurity
Top achievements
Rank 1
answered on 07 Apr 2009, 11:33 AM
thanks Princy
that's exactly what I am lookin' for...
0

r00tsecurity
Top achievements
Rank 1
answered on 07 Apr 2009, 11:42 AM
and lastly can we insert literal text between these two datafields like;
<telerik:GridCalculatedColumn DataFields="QUANTITY, SELECTED_UNIT" Expression="{0}+' '+ {1}"></telerik:GridCalculatedColumn>
or something like this?
<telerik:GridCalculatedColumn DataFields="QUANTITY, SELECTED_UNIT" Expression="{0}+{1}" DatatFormatString="{0} space {1}" ></telerik:GridCalculatedColumn>
<telerik:GridCalculatedColumn DataFields="QUANTITY, SELECTED_UNIT" Expression="{0}+' '+ {1}"></telerik:GridCalculatedColumn>
or something like this?
<telerik:GridCalculatedColumn DataFields="QUANTITY, SELECTED_UNIT" Expression="{0}+{1}" DatatFormatString="{0} space {1}" ></telerik:GridCalculatedColumn>
0

Ram
Top achievements
Rank 1
answered on 23 Jul 2011, 08:02 AM
Hi Princy.
I'm using radgrid.
In one gridboundcolm I'm dispaying the duration as like 360 numeric numbers.
I want to show that numer in hh:mm:sec format. like 00:06:00 how can I do it
Please help me.
I'm using radgrid.
In one gridboundcolm I'm dispaying the duration as like 360 numeric numbers.
I want to show that numer in hh:mm:sec format. like 00:06:00 how can I do it
Please help me.
0

Princy
Top achievements
Rank 2
answered on 25 Jul 2011, 08:34 AM
Hello Ram,
Try setting the DataFormatString as shown below.
aspx:
Thanks,
Princy.
Try setting the DataFormatString as shown below.
aspx:
<
telerik:GridBoundColumn
UniqueName
=
"BirthDate"
HeaderText
=
"BirthDate"
DataField
=
"BirthDate"
DataFormatString
=
"{0:hh:mm:tt}"
>
</
telerik:GridBoundColumn
>
Thanks,
Princy.
0

Ram
Top achievements
Rank 1
answered on 25 Jul 2011, 11:02 AM
Hi Princy thanks for ur reply.
But its not working as I expected.
Is show the string as "hh:mm:tt:
its not converting number to hh:mm:tt format.
Cloud you help me please
But its not working as I expected.
Is show the string as "hh:mm:tt:
its not converting number to hh:mm:tt format.
Cloud you help me please
0

Shivanshu
Top achievements
Rank 2
answered on 08 Jan 2013, 05:58 AM
Hi, What can i do if i need to bind data some more complex expression like :
<chorus:GridBoundColumn DataField="<%= (ActiveFlag!=0)?true:false%>" HeaderText="ActiveFlag" UniqueName="ActiveFlag" DataType="System.Boolean" >
0

Princy
Top achievements
Rank 2
answered on 11 Jan 2013, 09:18 AM
Hi,
As far as I know, you cannot set the value in markup. One suggestion is that you can set the text from code as shown below.
C#:
Thanks,
Princy
As far as I know, you cannot set the value in markup. One suggestion is that you can set the text from code as shown below.
C#:
protected
void
RadGrid2_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
if
(item[
"Uniquename"
].Text ==
"0"
)
{
item[
"Uniquename"
].Text=
"true"
;
}
}
}
Thanks,
Princy
0

Shivanshu
Top achievements
Rank 2
answered on 11 Jan 2013, 11:57 AM
Hi Princy..Thanks for your help. However, I was was looking for inline mark-up solution like below which i got later.
<telerik:GridTemplateColumn HeaderText="ActiveFlag" DataType="System.Boolean"> <ItemTemplate> <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# ((int.Parse(Eval("ActiveFlag").ToString()) != 0) ? true : false)%>' Enabled="false"/> </ItemTemplate> </telerik:GridTemplateColumn> It's working for me. anyway, Thank for your time . :)