Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
121 views
I have a RadGrid that is using a FormTemplate when inserting/updating values.

One of the values in my SQL Table is a bit flag. That is, it's going to be either true or false.

I can easily set this bit using a checkbox like the following in my FormTemplate:

<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("CanBeFatal") != DBNull.Value ? Convert.ToBoolean(Eval("CanBeFatal")) : false %>' />

This essentially selects the checkbox if the flag is set to true. However, I would prefer to display a RadComboBox instead of a checkbox and set the selected item based on the value of the bit flag. I've tried various methods to achieve this, but haven't had any success. I'm not sure if this is even possible, but any help would be appreciated.

Based on the sample below, if my bit flag is set to false, I would like the RadComboBox to have the 2nd item selected. For simplity of this message, I am leaving out the various methods I used to evaluate the bit flag and attempt to set the selection in the sample to avoid confusion.

<telerik:RadComboBox ID="RadComboBox2" runat="server" >
    <Items>
        <telerik:RadComboBoxItem Text="Yes" Value="true" />
        <telerik:RadComboBoxItem Text="No" Value="false" />
    </Items>
</telerik:RadComboBox>

Thanks!

UPDATE:
I was finally able to set the selection after playing a bit more. Seems the value for the bit is case sensitive. I got it working by doing the following:

<telerik:RadComboBox ID="RadComboBox2" runat="server" SelectedValue='<%# Eval("CanBeFatal") %>'>
    <Items>
        <telerik:RadComboBoxItem Text="Yes" Value="True" />
        <telerik:RadComboBoxItem Text="No" Value="False" />
    </Items>
</telerik:RadComboBox>

Guess I spoke to soon. Hope this helps someone else!
Paul
Top achievements
Rank 1
 asked on 07 Jan 2011
1 answer
245 views
Hello in my grid i hv one button inside the grid ..

<telerik:GridTemplateColumn DataField="DelFlag" HeaderText="Status" SortExpression="DelFlag"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="DelFlag" Visible="true" AllowFiltering="false">
                            <ItemTemplate>
                               <asp:Button ID="btnStatus" Font-Size="11px" Width="65px" runat="server" Text='<%#Eval("DelFlag")%>'
                                 CommandName="Command" />                                
                            </ItemTemplate>
                            <ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>

if user click on button want to show the message "Are you sure want's to change status?". if user click yes then update status otherwise not.

 Please find attached image file u get an idea.   In image file Status column that button .. on click on that button want to show the confirmation message.



thanks
Mike Nogen
Top achievements
Rank 1
 answered on 07 Jan 2011
5 answers
132 views
Hi everyone.
I don“t speak very well english so my apologizes

I am user of telerik asp.net Ajax, and i like it .
I have tried the aspxTreelist of Devexpress and i was expecting something alike, but is not, i am very upset.

I was expecting double click expand/colapse, sumary , Edit on place (like form) , scrollbars ,etc..

I have a project to finish and i use Telerik Asp.Net Ajax , but i have to buy only the component of aspxTreeList of Devexpress :(

I expect that issues comes in the next release.

Thanks




Sebastian
Telerik team
 answered on 07 Jan 2011
10 answers
239 views
Hi,

I have a radmenu in a user control which is loaded dyanamically from another user control. On first load of the site, i.e. after compilation, the menu operates correctly but on subsequent loads it does not an iisreset is needed for the menu to work again. This is due to me having output caching enabled (sql cache dependency). I get the sys is not defined/telerik not defined errors.

Remove the caching and everything is fine. I need to cache the menu / data as it is intensive to get the data. Anyone know what I need to do so I can set the output cache and the menu continue to work properly?

Thanks,

Leon.

Simon
Telerik team
 answered on 07 Jan 2011
1 answer
81 views
Hi,
i've got a problem with telerik combobox in IE, when I enter the combobox and press BackSpace it redirects me to the previous page.

In FF, it works fine. Don't you know where could be a problem?

Here is my code:
<telerik:RadComboBox ID="comboCompany" runat="server" Width="304px" OnClientSelectedIndexChanging="LoadSites">
 </telerik:RadComboBox>



Thanks for answer.
abasi
Top achievements
Rank 1
 answered on 07 Jan 2011
12 answers
438 views
Hello,

I have a RadGrid populated from a method in a class file. When I bind the grid one of the columns is populated with a space, " ". For some reason, this causes the RadGrid to not place borders/gridlines around the items in that column. I've attached an example of what this looks like.

Any help would be appreciated.

Thanks,
Casey
Andy
Top achievements
Rank 1
 answered on 07 Jan 2011
6 answers
191 views
Hi all,

I'm having a custom skin which is modified from Telerik Skin.
EnableEmbeddedSkins="false" Skin="MySkin"

In my website, user has his/her own favorite color. And I would like to apply that color for Grid header.
For example, user A has Orange color and the background color of RadGrid header must be orange. 

Are there any ways to modify the "MySkin"?

Regards,

Andy.

EnableEmbeddedSkins="false" Skin="MySkin"

Pavlina
Telerik team
 answered on 07 Jan 2011
3 answers
70 views
Dear Support

I am totally new to Telerik Reporting Q3 2010. Please me some references, links, tutorials, worked out examples to learn this new reporting feature.
I want to know is telerik reporting Q3 2010 can be done with Visual Studio 2008. or Visual Studio 2010.

Please give me some link reference to study in details

Thank you
Steve
Telerik team
 answered on 07 Jan 2011
3 answers
426 views
Hello i want to sort each column i set all property but sorting not working in my case.


<telerik:RadGrid ID="grdGameInfo" runat="server" AllowPaging="True" AllowSorting="True"
                GridLines="None" Skin="Office2007" AutoGenerateColumns="false" Width="800px"
                AllowAutomaticInserts="false" AlternatingItemStyle-BackColor="#F0F0F0" AllowFilteringByColumn="true"
                AllowAutomaticUpdates="false" AllowAutomaticDeletes="false" PageSize="10" OnItemDataBound="grdGameInfo_ItemDataBound"
                OnSortCommand = "grdGameInfo_SortCommand"  EnableViewState ="true"
                OnItemCreated="grdGameInfo_ItemCreated" OnNeedDataSource="grdGameInfo_NeedDataSource"
                OnItemCommand="grdGameInfo_ItemCommand" OnPageSizeChanged="grdGameInfo_PageSizeChanged"
                OnInsertCommand="grdGameInfo_InsertCommand" OnPageIndexChanged="grdGameInfo_PageIndexChanged">
                <GroupingSettings CaseSensitive="false" />
                <PagerStyle Mode="NextPrevAndNumeric" />
                <MasterTableView EditMode="EditForms" Width="800px" CommandItemDisplay="Top" DataKeyNames="DelFlag,IsDeleted"
                AllowNaturalSort ="false" AllowMultiColumnSorting="true">
                    <Columns>
                        <telerik:GridTemplateColumn DataField="GameGID" HeaderText="GameGID" SortExpression="GameGID"
                            ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" UniqueName="GameGID"
                            Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblGameGID" runat="server" Text='<%#Eval("GameGID")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGameGID" TabIndex="0" runat="server" Text='<%#Eval("GameGID")%>'></asp:TextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                            ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" EditImageUrl="../../images/edit.gif"
                            HeaderStyle-Width="20px" HeaderText="Edit" AutoPostBackOnFilter="true">
                            <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn DataField="MA" HeaderText="State" SortExpression="MA"
                            ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" UniqueName="MA"
                            FilterControlWidth="50px" AutoPostBackOnFilter="True" ShowFilterIcon="false"
                            CurrentFilterFunction="Contains">
                            <ItemTemplate>
                                <asp:Label ID="lblState" runat="server" Text='<%#Eval("MA")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtState" TabIndex="1" Enabled="true" runat="server" Text='<%#Eval("MA")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGameState" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtState" Text="Please enter Game state."></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="custmValState" runat="server" ControlToValidate="txtState"
                                    OnServerValidate="custmValState_ServerValidate" ErrorMessage="Invalid State."></asp:CustomValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Number" DataField="GameNumber" SortExpression="GameNumber"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="GameNumber" AutoPostBackOnFilter="True"
                            ShowFilterIcon="false" CurrentFilterFunction="Contains" FilterControlWidth="70px">
                            <ItemTemplate>
                                <asp:Label ID="lblGameNumber" runat="server" Text='<%#Eval("GameNumber")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGameNumber" onkeydown="return isNumeric(event.keyCode);" Enabled="true"
                                    TabIndex="2" runat="server" Text='<%#Eval("GameNumber")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGameNumber" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtGameNumber" Text="Please enter Game number.">
                                </asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="custmGameNumber" runat="server" ControlToValidate="txtState"
                                    OnServerValidate="custmValGameNumber_ServerValidate" ErrorMessage="Game Number is already in the system."></asp:CustomValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="GameName" HeaderText="Name" SortExpression="GameName"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="GameName" AutoPostBackOnFilter="True"
                            ShowFilterIcon="false" CurrentFilterFunction="Contains" FilterControlWidth="100px">
                            <ItemTemplate>
                                <asp:Label ID="lblGameName" runat="server" Text='<%#Eval("GameName")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGameName" TabIndex="3" runat="server" Text='<%#Eval("GameName")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGameName" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtGameName" Text="Please enter Game name."></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="custmValGameName" runat="server" ControlToValidate="txtGameName"
                                    OnServerValidate="custmValGameName_ServerValidate" ErrorMessage="Game Name is already in the system.">
                                </asp:CustomValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="GameUPC" HeaderText="UPC" SortExpression="GameUPC"
                            HeaderStyle-HorizontalAlign="Center" FilterListOptions="AllowAllFilters" AutoPostBackOnFilter="True"
                            ShowFilterIcon="false" CurrentFilterFunction="Contains" UniqueName="GameUPC">
                            <ItemTemplate>
                                <asp:Label ID="lblGameUPC" runat="server" Text='<%#Eval("GameUPC")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGameUPC" onkeydown="return isNumeric(event.keyCode);" Enabled="true"
                                    MaxLength="12" TabIndex="4" runat="server" Text='<%#Eval("GameUPC")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGameUPC" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtGameUPC" Text="Please enter Game UPC code."></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="custmValGameUPC" runat="server" ControlToValidate="txtGameUPC"
                                    OnServerValidate="custmValGameUPC_ServerValidate" ErrorMessage="Game UPC is already in the system.">
                                </asp:CustomValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="GamePrice" HeaderText="Price" SortExpression="GamePrice"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="GamePrice" AutoPostBackOnFilter="True"
                            FilterControlWidth="40px" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                            <ItemTemplate>
                                <%--<%# DataBinder.Eval(Container.DataItem, "GamePrice", "{0:C}")%>--%>
                                <asp:Label ID="lblGamePrice" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "GamePrice", "{0:C}")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGamePrice" runat="server" onkeydown="return isNumericPrice(event.keyCode);"
                                    TabIndex="5" Text='<%# Eval("GamePrice")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGamePrice" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtGamePrice" Text="Please enter Game price."></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="custmValGamePrice" runat="server" ControlToValidate="txtGameUPC"
                                    OnServerValidate="custmValGamePrice_ServerValidate" ErrorMessage="Price must be in the format of a valid dollar amount 0.00">
                                </asp:CustomValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="DelFlag" HeaderText="Status" SortExpression="DelFlag"
                            HeaderStyle-HorizontalAlign="Center" UniqueName="DelFlag" Visible="true" AllowFiltering="false">
                            <ItemTemplate>
                                <asp:Button ID="btnStatus" Font-Size="11px" Width="65px" runat="server" Text='<%#Eval("DelFlag")%>'
                                    OnClientClick="javascript:return confirm('Are you sure want to update status !!?')"
                                    CommandName="Command" />
                            </ItemTemplate>
                            <ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="GameMax" HeaderText="Tickets In Book " SortExpression="GameMax"
                            HeaderStyle-HorizontalAlign="Center" FilterListOptions="AllowAllFilters" AutoPostBackOnFilter="True"
                            Visible="false" UniqueName="GameMax">
                            <ItemTemplate>
                                <asp:Label ID="lblGameMax" runat="server" Text='<%#Eval("GameMax")%>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtGameMax" Enabled="true" onkeydown="return isNumeric(event.keyCode);"
                                    MaxLength="4" TabIndex="5" runat="server" Text='<%#Eval("GameMax")%>'></asp:TextBox>
                                <asp:RequiredFieldValidator ID="reqFieldValGameMax" runat="server" ErrorMessage="RequiredFieldValidator"
                                    ControlToValidate="txtGameMax" Text="Please enter ticket in book."></asp:RequiredFieldValidator>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="AssignStore" UniqueName="AssignStore" Visible="false">
                            <EditItemTemplate>
                                <asp:CheckBox ID="chkAssignStores" Text="Assign to all Stores" runat="server" Checked="false"
                                    AutoPostBack="true" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn ConfirmText="Delete this Game?" ConfirmDialogType="RadWindow"
                            HeaderText="Delete" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete"
                            Text="Delete" HeaderStyle-Width="20px" UniqueName="DeleteColumn">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle ForeColor="#326DA0" BackColor="#EEEEEE" BorderStyle="Solid" BorderColor="#326DA0" />
                        </telerik:GridButtonColumn>
                        <telerik:GridTemplateColumn UniqueName="IsDeleted" AllowFiltering="false" HeaderStyle-Width="20px"
                            SortExpression="IsDeleted" DataField="IsDeleted" Visible="false">
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <EditFormSettings ColumnNumber="4" CaptionDataField="GameName" CaptionFormatString="Edit Details of Game :  {0}"
                        InsertCaption="New Game">
                        <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                        <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                            Width="100%" />
                        <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                        <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                            UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                        </EditColumn>
                        <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
                    </EditFormSettings>
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                </MasterTableView>
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                </FilterMenu>
            </telerik:RadGrid>




Tell me how perform multi column sorting
Mike Nogen
Top achievements
Rank 1
 answered on 07 Jan 2011
17 answers
1.0K+ views
I'm coming from a ASP .NET AJAX / Toolkit background and I'm used to developing windows that follow this pattern:

In the ASPX I would have an UpdatePanel in the body of the page and a ModalPopupExtender which would contain an UpdatePanel.  The event handler for the trigger on the page would populate values in the ModalPopupExtender's UpdatePanel and then display it via the Show() method.  The event handler for the Save button on the ModalPopupExtender would do any additional validation/persistence and, if successful, update values on the calling page's UpdatePanel and Hide() the dialog window. 

Is it possible to implement this pattern using the Prometheus Window and AjaxPanel/AjaxManager without having to write Javascript?
Hossein Jabbarzadeh
Top achievements
Rank 1
 answered on 07 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?