Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
200 views
I have an edit form inside of a grid and i need to set the data source for the RadComboBox to be populated from a LINQ query that runs on page load. I cant figure out how to do this:

The LINQ statement used is: tudc.Users.Select(f => f.Team).Distinct().ToArray();

                        <EditFormSettings EditFormType="Template">
                        <FormTemplate>
                            <table id="ET" cellpadding="1" cellspacing="0" width="100%" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                <tr class="EditFormHeader"><td colspan="2">User Details</td></tr>
                                <tr>
                                   <td class="FieldName">Last Name:</td><td><telerik:RadTextBox runat="server" Skin="Office2010Blue" ID="rtb_LastName" Text='<%# Bind("Name_Last") %>' /></td>
                                </tr><tr>
                                   <td class="FieldName">First Name:</td><td><telerik:RadTextBox runat="server" Skin="Office2010Blue" ID="rtb_FirstName" Text='<%# Bind("Name_First") %>' /></td>
                                </tr><tr>
                                   <td class="FieldName">Username:</td><td><telerik:RadTextBox runat="server" Skin="Office2010Blue" ID="rtb_Username" Text='<%# Bind("Username") %>' /></td>
                                </tr><tr>
                                   <td class="FieldName">Password:</td><td><telerik:RadTextBox runat="server" Skin="Office2010Blue" ID="rtb_Password" TextMode="Password" Text='<%# Bind("Username") %>' /></td
                                </tr><tr>
                                   <td class="FieldName">Type:</td><td><telerik:RadComboBox runat="server" Skin="Office2010Blue" ID="rcb_Type" SelectedValue='<%# Bind("Type") %>' DataSource='<%# (new string[] {"Team Lead", "EDA", "Hybrid", "Admin"}) %>' /></td>
                                </tr><tr>
                                   <td class="FieldName">Team:</td><td><telerik:RadComboBox runat="server" Skin="Office2010Blue" ID="rcb_Team" SelectedValue='<%# Bind("Team") %>' DataSource='<%#?!?!?!?! WHAT GOES HERE %>' /></td>
                                </tr>
                            </table>
                        </FormTemplate>
                        </EditFormSettings>
Shinu
Top achievements
Rank 2
 answered on 27 Mar 2013
5 answers
656 views
If the image field is NULL, an error will be got : Unable to cast object of type 'System.DBNull' to type 'System.Byte[]' 
peter
Top achievements
Rank 1
 answered on 27 Mar 2013
1 answer
101 views
I am a newbie to c# and the telerik controls and would appreciate some help.  I have created a grid, populated it (banded it) and it work perfect. Now I need to set up filters. A few of the filters are RadCombo that I would like to bind. The following is code for my aspx for the grid. "colEquipmentType" is the column that I would like a filter. As you can see in the attached image I am able to get the control in the column. The largest issue that I am having is binding in my .cs file. 

Thanks for any help you can give me.


 <%--Grid--%>
            <td class="grid" rowspan="9">
                <telerik:RadGrid runat="server" ID="rgEquipmentRecords" CellSpacing="0" Skin="Vista"
                    Width="98%" AutoGenerateColumns="False" GridLines="None" AllowSorting="True"
                    OnNeedDataSource="rgEquipmentRecords_NeedDataSource" AllowPaging="True" GroupingEnabled="False"
                    OnItemCommand="rgEquipmentRecords_ItemCommand" AllowFilteringByColumn="True">
                    <AlternatingItemStyle BackColor="AliceBlue" />
                    <ItemStyle BackColor="White" />
                    <PagerStyle Mode="NextPrev" AlwaysVisible="True" ShowPagerText="False" />
                    <MasterTableView DataKeyNames="EquipmentType,Qty,IssuedTo,DateIssued,Approvedby,IssuedBy,ID,Notes"
                        PageSize="13">
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <%--Grid Column Record Id--%>
                            <telerik:GridBoundColumn DataField="ID" HeaderText="Rec ID" ReadOnly="true" UniqueName="colID"
                                ItemStyle-HorizontalAlign="center" AllowFiltering="False">
                                <HeaderStyle HorizontalAlign="Center" Width="60px" />
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </telerik:GridBoundColumn>


                            <%--Grid Column Equipment Type--%>
                            <telerik:GridBoundColumn DataField="EquipmentType" HeaderText="Equip Type" ReadOnly="true"
                                UniqueName="colEquipmentType" ItemStyle-HorizontalAlign="Left">
                                <HeaderStyle Width="90px" />
                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="cboEquipmentTypeFilter" DataTextField="DESC"
                                    DataValueField="ID" Height="200px" AppendDataBoundItems="true" 
                                        runat="server" >
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>


                            <%--Grid Column QTY--%>
                            <telerik:GridBoundColumn DataField="Qty" HeaderText="QTY" ReadOnly="true" UniqueName="colQty"
                                ItemStyle-HorizontalAlign="Center" AllowFiltering="False">
                                <HeaderStyle HorizontalAlign="Center" Width="60px" />
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <%--Grid Column BarCode Number--%>
                            <telerik:GridBoundColumn DataField="BarcodeNumber" HeaderText="Barcode" ReadOnly="true"
                                UniqueName="colBarcode" ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle HorizontalAlign="Center" Width="60px" />
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <%--Grid Column Dept/Div/Emp Issued--%>
                            <telerik:GridBoundColumn DataField="IssuedTo" HeaderText="Dept/Div/Emp Issued" ReadOnly="true"
                                UniqueName="colDeptDivEmpIssue" AllowFiltering="False">
                                <HeaderStyle Width="200px" />
                            </telerik:GridBoundColumn>
                            <%--Grid Column Date Issue--%>
                            <telerik:GridBoundColumn DataField="DateIssued" HeaderText="Date Issue" ReadOnly="true"
                                UniqueName="colDateIssue">
                                <HeaderStyle Width="110px" />
                            </telerik:GridBoundColumn>
                            <%--Grid Column Approved By--%>
                            <telerik:GridBoundColumn DataField="Approvedby" HeaderText="Approved By" ReadOnly="true"
                                UniqueName="colApprovedby">
                                <HeaderStyle Width="150px" />
                            </telerik:GridBoundColumn>
                            <%--Grid Column Issued By--%>
                            <telerik:GridBoundColumn DataField="IssuedBy" HeaderText="Issued By" ReadOnly="true"
                                UniqueName="colIssuedBy">
                                <HeaderStyle Width="150px" />
                            </telerik:GridBoundColumn>
                            <%--Grid Column Notes--%>
                            <telerik:GridBoundColumn DataField="Notes" HeaderText="Notes" ReadOnly="true" UniqueName="colNotes"
                                AllowFiltering="False">
                                <HeaderStyle Width="150px" />
                            </telerik:GridBoundColumn>
                            <%--Grid Column Delete--%>
                            <telerik:GridButtonColumn UniqueName="colDelete" HeaderText="Delete" ButtonType="ImageButton"
                                ItemStyle-HorizontalAlign="center" ConfirmText="This action will delete the selected record, are you sure?"
                                ConfirmDialogType="RadWindow" CommandName="Delete" ImageUrl="~/Images/Icons/DeleteRed.png">
                                <HeaderStyle Width="70px" />
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle Mode="NextPrev" />
                        <HeaderStyle Font-Bold="true" Font-Size="Small" Height="10px" />
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 27 Mar 2013
1 answer
86 views
Hi,

How can  I get the first item in RadListbox in Javascript?

Thanks,
Karl.
Princy
Top achievements
Rank 2
 answered on 27 Mar 2013
1 answer
164 views
hi,
  I have 2 pages. Form1 is Grid page to show the data. Form 2 popup page which popup when a add button clicked in Form1 or click a particular data in the Grid for edit. The Form 2 have a Toolbar which have save and close button. The close button is for cancel so use java script to just close the window (Client click event of toolbar). This is fine. For save button i have server side event which saves the entered data in to the database and close the window and rebind the form 1 grid to update the new data. In the server side event i user Registerstartup script to call the javascript method to close and rebind the grid. This is working fine when i not used ajax. Now i enabled ajax for toolbar. Now when i click in save button data is saving but window is not closing. Can anyone help me?
Akhil Raj
Top achievements
Rank 1
 answered on 27 Mar 2013
4 answers
62 views

Hi,

Currently, we have implemented the RadTimePicker controller in our web application. But the customer wants to use the dropdownlist like outlook style? Could the control display like that?

If not, is there any code refactoring we could implement it to that style?

Alex

Alex
Top achievements
Rank 1
 answered on 27 Mar 2013
1 answer
54 views
I have a web application that is using RadAjaxManager to enable partial postback to the page.
I have a placeholder on the page that I am adding usercontrols to it's controls collection through code behind after a partial postback. 
The controls are created and displayed correctly. however when I go to retrieve the values, the placeholder controls collection is  null even though i am not updating the placeholder on partial postback via ajaxsetting.
Since I am not updating the placeholder on postback of the submit button, the controls do not dissapear off the page but the placeholder.controls collection is empty/null.
Any ideas?
Brett
Top achievements
Rank 1
 answered on 26 Mar 2013
4 answers
325 views
I am using a RadGrid and sorting is not working.  As an experiment I removed my grid and replaced with the grid from the
"Grid - Advanced Data Binding" demo. http://demos.telerik.com/aspnet-ajax/grid/examples/programming/needdatasource/defaultvb.aspx?#qsf-demo-source 

I linked to my data: RadGrid1.DataSource = GetSearchData() and the grid appeared displaying my data but sorting does not work.

When I click to sort,
        Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
            RadGrid1.DataSource = GetSearchData()
        End Sub

is called.  The data is returned but it is not sorted,

Any idea how I can get sorting to work?
David
Top achievements
Rank 1
 answered on 26 Mar 2013
10 answers
452 views
I want to use the Vista skin but override the chart background to white. Is this not possible without having to make my own skin? The following is not working for me:

<telerik:RadChart ID="chart" Skin="Vista" runat="server"
    <Appearance> 
        <Border Visible="false" /> 
        <FillStyle FillType="Solid" MainColor="White" /> 
    </Appearance> 
</telerik:RadChart> 

Thank you


Ab
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
110 views
Hi,
I am using text wrap on the columns of the radgrid but when the text wraps, instead of moving complete words to the next line, it moves the words partially. Attached jpg file will show you the issue.
Any pointers on what am I missing here?

Thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?