Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
141 views

I am using RadControls for ASP.NET AJAX, Q3, .net 2.0 and Visual Studio 2008. The Combobox works fine with normal page but has abnormal appearance when used with masterpage. This error is different with each skin, but in general it seems to be doubled.

I cannot post some pictures here, so I use 4shared for your reference.

http://www.4shared.com/file/75578813/a05ff0c4/Snap1-Web20_Skin.html
http://www.4shared.com/file/75578812/d758c052/Snap2-Inox_Skin.html

Thanks.

Yana
Telerik team
 answered on 23 Dec 2008
5 answers
91 views
Hi All

How do I get the value of the DataFieldID when a user clicks on a tab?

I can get the text value of the tab with e.Tab.Text, but I need the ID to do a lookup.

Andy
Andy Green
Top achievements
Rank 2
 answered on 23 Dec 2008
2 answers
86 views
hi team

I have the following scenario

  1. User control that contians a rad grid with context menu (say uc1)
  2. User control that contains two web part zones.
  3. Each zone contains an instance of the (uc1) control (say uc11,uc12)

the problem is that

when I choose an item from the context menu of the grid in uc11 then the effect appears in the second instance (uc12)

is there any help for the problem.?

Remark:

  • we are using rad controls for asp.net ajax 2008 Q3.
  • IE 7 and Firefox
  • windows vista as operating system
Moustafa
Top achievements
Rank 1
 answered on 23 Dec 2008
0 answers
130 views
I have a RadToolBarDropDown wich is expanded over an IFrame. When the IFrame contains a textbox with focus the cursor in the textbox is displayed through the dropdown. I have tried different skins without sucess. Does anyone know how to make the cursor dissappear?

<telerik:radtoolbar id="RadToolBar1" runat="server" skin="Outlook">
                <Items>
                    <telerik:RadToolBarDropDown Text="Drop down">
                        <Buttons>
                            <telerik:RadToolBarButton Text="Bold"  Group="Bold" ></telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Italic"  Group="Italic" ></telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Underline"  Group="Underline" ></telerik:RadToolBarButton>
                        </Buttons>
                    </telerik:RadToolBarDropDown>
                </Items>
  </telerik:radtoolbar>
  <br /><br />
  <iframe src ="test.htm"></iframe>
Niclas
Top achievements
Rank 1
 asked on 23 Dec 2008
1 answer
92 views
Hi,

I am trying to assign a value to a CustomAttribute in code server side. 
So far everything else is working OK, but not sure if I need to take a different approach.

Dim lv As New dbLeave  
        Dim dt As New DataTable  
        dt = lv.StaffOtherLeave(StaffID, dateFrom, dateTo, Team)  
        RadScheduler1.DataKeyField = "UniqueID" 
        RadScheduler1.DataStartField = "DateFrom" 
        RadScheduler1.DataEndField = "DateTo" 
        RadScheduler1.DataSubjectField = "Subject" 
        RadScheduler1.Attributes("StaffID") = "StaffID"  
        RadScheduler1.DataSource = dt 
        RadScheduler1.DataBind() 

The RadScheduler1.Attribute("StaffID") obviously needs mapping to the StaffID column returned in the datatable, but doing the above is not going to work.  Do I need to loop through the datatable and manually assign this, or is there an easier method of allocating the StaffID column in the Datatable to the Custom Attribute of the RadScheduler?

Using RadScheduler in ASP.Net AJAX Version=2008.3.1210.20

David Penny
David Penny
Top achievements
Rank 2
 answered on 23 Dec 2008
3 answers
102 views
Our company is fairly new at ASP.Net development and Telerik, we are looking for assistance in development of specific area's in telerik controls. 

I don't know if this should be posted here, but we are looking to pay an individual to assist as needed with issues we run into.  

MUST have experience in Telerik controls, edit forms, using EditTemplates , ALL controls. 

email me back at astapleton@tcstire.com if you feel you can help.

thanks.
Sebastian
Telerik team
 answered on 23 Dec 2008
3 answers
149 views

I have a tab strip and a multip page with RenderSelectedPageOnly set to true.  When I click on a tab, I am loading a user control into an asp:Panel on the pageview.  I am re-loading the user control on a postback and that seems to be working fine.

In general, Inside the user control, where is the proper event in order to set the ajax settings programmatically to update controls on the page after an ajax call?  If I use OnLoad or PageLoad, it can't find the control to be updated.  I am currently using OnPreRender.

More specifically, inside the user control I have a grid.  In the onLoad event,  I add a RadAjaxManager.GetCurrent(Page).ResponseScripts.Add to call a client side function which issues an ajax call back to the server to load the contents of the grid.  Basically, I want to see the control, and then load the contents of the grid with an ajax call.  This is all functioning properly, however the grid is NOTupdated after the ajax call.  In the server side ajax request, I am adding an ajax setting for the mgr as the initiator and the grid as the target.  If I look at the rendered source for the page, I have 2 panels generated for the grid with the same id!  One has no data, and the other does have data.  In OnPreRender, I add an ajax setting for the grid to update itself in order to have the panel generated in the first place.

What am I doing wrong?

Thanks,

Leslie

Iana Tsolova
Telerik team
 answered on 23 Dec 2008
1 answer
101 views
Hello All,
   I'm new to C# and to Telerik.  My problem is that I'm modifying the supplied code to bind a datagrid to the scheduler's data.  Heres my code:

//Create a dynamic table to store the appointments' information:  
        DataTable table1 = new DataTable();
        table1.Columns.Add("ID");
        table1.Columns.Add("Instructor");

        foreach (Appointment a in RadScheduler1.Appointments)
        {
            if (a.RecurrenceState == RecurrenceState.Master)
            {
                RecurrenceRule parsedRule;
                RecurrenceRule.TryParse(a.RecurrenceRule.ToString(), out parsedRule);

                //If a recurring appointment does not have specified end time it will have  
                //endless occurrences. In this case you can explicitly put a restriction:  
                //parsedRule.SetEffectiveRange(DateTime.Now.AddYears(-1), DateTime.Now.AddYears(1));  
                foreach (DateTime occurrence in parsedRule.Occurrences)
                {
                    table1.Rows.Add(new string[] { a.Subject.ToString(), occurrence.ToString(), occurrence.Add(a.Duration).ToString() });
                }
            }
            else
                if (a.RecurrenceState != RecurrenceState.Occurence)
                {
                    //table1.Rows.Add(new string[] { a.Attributes["ID"].ToString(), a.Attributes["Instructor"].ToString()  });

                    string x = a.Attributes["Instructor"].ToString();

                    table1.Rows.Add(new string[] { a.Subject.ToString() });
                }
        }
        GridView1.DataSource = table1;
        GridView1.DataBind();
    }


The problem is that I get a NULL reference exception when trying to include the "Attributes" to the datagrid.  For instance:
   
table1.Rows.Add(new string[] { a.Subject.ToString() });  works, but
table1.Rows.Add(new string[] { a.Attributes["ID"].ToString() }); doesn't work.  Why?? And how do I get around it??





Peter
Telerik team
 answered on 23 Dec 2008
3 answers
137 views
Hello,

I followed your sample code to have mutliple DetailsTables (2), but can't get the second table to show up.

When I trace the binding event of the detailstables, both get filled with data, but only one shows up. If I change the order of the detailstables, then the other table will show with data, but again the second one in the hierachie (with index = 1) wont show.

Any help would be appreciated. Here's my code.

Context: Visual Studio 2008, .Net 3.5 with LinQ to SQL, Telerik Q2 2008 release.

Using OnNeedDataSource and OnDetailTableDataBind.

Aspx code:

<telerik:RadGrid ID="RadGrid1" Skin="Web20" ShowStatusBar="True" AllowSorting="True"
PageSize="1000" HorizontalAlign="Left" runat="server" AllowFilteringByColumn="True" ShowHeader="true"
Height="100%" Width="100%" OnDetailTableDataBind="radgrid1_detailtabledatabind" OnNeedDataSource="radgrid1_needdatasource" ShowGroupPanel="True" AllowAutomaticInserts="false"
GridLines="None" OnItemCommand="radgrid_insert" AutoGenerateColumns="False" EnableLinqExpressions="False" ShowFooter="False">
<GroupHeaderItemStyle Height="20px" />
<ExportSettings FileName="AthleteExport">
<Csv ColumnDelimiter="Semicolon" />
</ExportSettings>
<MasterTableView TableLayout="Auto" DataKeyNames="OID, ParentOID" ClientDataKeyNames="OID, ParentOID"
GroupLoadMode="Server">
<ItemStyle Height="20px" />
<AlternatingItemStyle Height="20px" />
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<DetailTables>
<telerik:GridTableView CommandItemDisplay="TopAndBottom"
InsertItemDisplay="Top" AllowAutomaticInserts="true"
DataKeyNames="AddressOID" ClientDataKeyNames="AddressOID" Width="100%"
AllowFilteringByColumn="False" BorderColor="#FF9933" BorderWidth="2px" GridLines="None"
Caption="Addresses" HierarchyLoadMode="ServerOnDemand">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="AthleteOID" MasterKeyField="ParentOID" />
</ParentTableRelation>
<ItemStyle Font-Italic="true" Font-Bold="False" Font-Names="Microsoft Sans Serif"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" />
<AlternatingItemStyle Font-Italic="true" />
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<Columns>
<telerik:GridBoundColumn DataField="Street" UniqueName="Street" HeaderText="Street">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="City" UniqueName="City" HeaderText="City">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AddressOID" ReadOnly="True" UniqueName="AddressOID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AthleteOID" ReadOnly="True" UniqueName="AthleteOID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>

</Columns>
<HeaderStyle BackColor="#FF9933" Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" Wrap="True" />
</telerik:GridTableView>
<telerik:GridTableView CommandItemDisplay="TopAndBottom"
InsertItemDisplay="Top" AllowAutomaticInserts="true"
DataKeyNames="OrderOID" ClientDataKeyNames="OrderOID" Width="100%"
AllowFilteringByColumn="False" BorderColor="#FF9933" BorderWidth="2px" GridLines="None"
Caption="Orders" HierarchyLoadMode="ServerOnDemand">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="AthleteOID" MasterKeyField="OID" />
</ParentTableRelation>
<ItemStyle Font-Italic="true" Font-Bold="False" Font-Names="Microsoft Sans Serif"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="True" />
<AlternatingItemStyle Font-Italic="true" />
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<Columns>
<telerik:GridBoundColumn DataField="DateCreated" UniqueName="DateCreated" HeaderText="Created"
DataFormatString="{0:d}">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DateSent" UniqueName="DateSent" HeaderText="Sent"
DataFormatString="{0:d}">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Status" UniqueName="Status" HeaderText="Status">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FileName" UniqueName="FileName" HeaderText="File">
<HeaderStyle HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RS" UniqueName="RS" HeaderText="RS">
<HeaderStyle Width="100px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AthleteOID" ReadOnly="True" UniqueName="AthleteOID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="OrderOID" ReadOnly="True" UniqueName="OrderOID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>
</Columns>
<HeaderStyle BackColor="#FF9933" Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" Wrap="True" />
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/styles/images/orders_icon.png" CommandArgument="showOrders"></telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="OID" ReadOnly="True" UniqueName="OID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ParentOID" ReadOnly="True" UniqueName="ParentOID" Visible="False" HeaderText="" >
</telerik:GridBoundColumn>
<custom:MyGridCustomFilter DataField="Prefix" UniqueName="Prefix" HeaderText="RS" HeaderStyle-Width="40px" ItemStyle-Width="40px">
</custom:MyGridCustomFilter>
<telerik:GridBoundColumn DataField="LastName" UniqueName="LastName" HeaderText="Lastname">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="FirstName">
</telerik:GridBoundColumn>
<custom:MyGridCustomFilter DataField="Gender" UniqueName="Gender" HeaderText="Gender">
</custom:MyGridCustomFilter>
<telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="Nat." AllowFiltering="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DateOfBirth" UniqueName="DateOfBirth" HeaderText="Date Of Birth"
DataFormatString="{0:d}">
</telerik:GridBoundColumn>
<custom:MyGridCustomFilter ItemStyle-Wrap="false" HeaderStyle-Width="25%" ItemStyle-Width="25%"
DataField="AgentName" UniqueName="AgentName" HeaderText="Agent">
<HeaderStyle Width="25%"></HeaderStyle>
<ItemStyle Wrap="False" Width="25%"></ItemStyle>
</custom:MyGridCustomFilter>
<custom:MyGridCustomFilter DataField="Categorie" UniqueName="Categorie" HeaderText="Cat.">
</custom:MyGridCustomFilter>
</Columns>
</MasterTableView>
<ClientSettings AllowDragToGroup="True" AllowColumnsReorder="true" AllowGroupExpandCollapse="true">
<ClientEvents OnRowDblClick="RowDblClick" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />
<Selecting AllowRowSelect="true" />
</ClientSettings>
<FilterMenu Skin="Web20" EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
<GroupingSettings CaseSensitive="false" />
</telerik:RadGrid>



OnNeedDataSource:


protected void radgrid1_needdatasource(object source, GridNeedDataSourceEventArgs e)
{
DataClassesDataContext ctx = ContextManager.GetActiveContext();

string gender = Request.QueryString["gender"];
string cat = Request.QueryString["cat"];

if (cat == "TF") cat = "T&F"; //todo hack!!

string categorie = Server.UrlDecode(cat);


var qry = Athletes.GetGridData(ctx, gender, categorie);

var athletes =
qry.Select(
q =>
new
{
q.AgentName,
q.Categorie,
q.DateOfBirth,
q.FirstName,
q.Gender,
q.LastName,
q.Name,
q.OID,
q.Prefix,
ParentOID = q.OID
});

var list = athletes.ToList();
RadGrid1.DataSource = list;


//create dropdownlists for filters
CreateColumnDropdowns();

}

private void CreateColumnDropdowns()
{
foreach (GridColumn gridColumn in RadGrid1.MasterTableView.Columns)
{
if (gridColumn.GetType() == typeof(MyGridCustomFilter))
{
MyGridCustomFilter column = gridColumn as MyGridCustomFilter;

if (column.UniqueName == "AgentName")
{
column.ListDataSource = GetFilterTable(column.DataField);
}

else if (column.UniqueName == "Gender")
{
column.ListDataSource = GetFilterTable(column.DataField);
}

else if (column.UniqueName == "Prefix")
{
column.ListDataSource = GetFilterTable(column.DataField);
}

else if (column.UniqueName == "Categorie")
{
column.ListDataSource = GetFilterTable(column.DataField);
}
}

}
}




OnDetailTableDataBind:


protected void radgrid1_detailtabledatabind(object source, GridDetailTableDataBindEventArgs e)
{

if (e.DetailTableView.DetailTableIndex == 0) //addresses subtable
{
IQueryable<view_Address> qryAddress = EntityController<view_Address>.RetrieveAll();

var adres =
qryAddress.Select(
q =>
new
{
q.AthleteOID,
q.Street,
q.Zip,
q.Country,
q.City,
q.AddressOID
});

var addresses = adres.ToList();

RadGrid1.MasterTableView.DetailTables[0].DataSource = addresses;
RadGrid1.MasterTableView.DetailTables[0].Visible = true;

GridRelationFields relationFields = new GridRelationFields();
RadGrid1.MasterTableView.DetailTables[0].ParentTableRelation.Add(relationFields);
relationFields.MasterKeyField = "ParentOID";
relationFields.DetailKeyField = "AthleteOID";
//end addresses subtable
}
else if(e.DetailTableView.DetailTableIndex == 1)//orders subtable
{
IQueryable<Order> qry = EntityController<Order>.RetrieveAll();

var t =
qry.Select(
q =>
new
{
OrderOID = q.OID,
q.Status,
q.DateCreated,
q.DateSent,
q.AthleteOID,
q.filename,
RS = q.SystemUser.ToString()
});

var orders = t.ToList();
RadGrid1.MasterTableView.DetailTables[1].DataSource = orders;
RadGrid1.MasterTableView.DetailTables[1].Visible = true;

GridRelationFields relationFields = new GridRelationFields();
RadGrid1.MasterTableView.DetailTables[1].ParentTableRelation.Add(relationFields);
relationFields.MasterKeyField = "OID";
relationFields.DetailKeyField = "AthleteOID";

//end orders subtable
}


}
Yeroon
Top achievements
Rank 2
 answered on 23 Dec 2008
1 answer
86 views
Hi,
I have grid like this:
        <telerik:RadGrid ID="YachetGrid" Width="97%" AllowAutomaticUpdates="False" AllowAutomaticDeletes="False" AllowPaging ="true" PageSize="1"
           OnPageIndexChanged="Yacht_PageChanged"   GridLines="None" runat="server" Skin="Vista" ShowFooter="True" OnItemDataBound="YachetGrid_OnDatabound" EnableEmbeddedSkins="false">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" GridLines="None" CommandItemDisplay="None"  EditMode="InPlace"
                HorizontalAlign="NotSet" DataKeyNames="YachtID" AutoGenerateColumns="false">
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <Columns>
                    <telerik:GridTemplateColumn >
        <ItemTemplate>
            <div>
            <center>
                <h2><asp:Label id="YachetNameLabel" runat="server" ></asp:Label>  </h2>
                <p style="padding-top: 10px; padding-bottom: 5px;">
                <asp:Label id="MainSummaryLabel" runat="server" ></asp:Label>
                </p>
            </center>
            </div>
            <div style="float:left;  width:300px;">
            <table width="100%">
            <tr>
            <td colspan="2" class="OrangeFont"  >
            Details
            </td>
            </tr>
             <tr>
            <td>
            Builder
            </td>
            <td>
            <asp:Label id="BuilderNameLabel" runat="server" ></asp:Label>
            </td>
            </tr>
            </table>
            </div>
            <div style=" margin-left:350px;  width:300px;">
            <table width="100%">
            <tr>
            <td colspan="2" class="OrangeFont" >
            Engine
            </td>
            </tr>
             <tr>
            <td>
            Type
            </td>
            <td>
            <asp:Label id="EngineTypeLabel" runat="server" ></asp:Label>
            </td>
            </tr>
            </table>
            </div>
            <div style="clear:left">
           <table  width="100%">
            <tr>
            <td colspan="2" class="OrangeFont" >
            Refit
            </td>
            </tr>
          <asp:Repeater ID="RefitRepeater" runat="server" OnItemDataBound="RefitRepeater_OnItemDataBound" >
           <ItemTemplate>
           <tr>
           <td>  <asp:Label ID="refitYear" runat="server" ></asp:Label></td>
           <td>  <asp:Label ID="refitContent" runat="server" Text="Label"></asp:Label></td>
           </tr>
           </ItemTemplate>
           </asp:Repeater>
           </table>
       </div>     
            
        </ItemTemplate>
                 </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

It has a table and a repeater in the grid. When Item_databound event happens for the grid, I will bind the repeater.
The problem is that I am sure the database contains more than 1 data, but the grid only displays one. I have set paging style in, but I can't even see the previous and next link (not even disabled ones).

Can someone help me?

Many Thanks

Jerry

Princy
Top achievements
Rank 2
 answered on 23 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?