Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 views
My problem happens after I have added and removed a tab.
var tabStrip = $find("<%= RadTabStrip1.ClientID %>"); 
var selectedTab = tabStrip.findTabByText("StopOffs"); 
tabStrip.trackChanges(); 
if (selectedTab == null) { 
    var tab = new Telerik.Web.UI.RadTab(); 
    tabStrip.get_tabs().insert(2,tab); 
    tab.set_text("StopOffs"); 
    tab.set_pageViewID("TABSTOPOFF"); 
    selectedTab = tabStrip.findTabByText("StopOffs"); 
... 
if (a == "YES") { 
    selectedTab.set_visible(true); 
else { 
    tabStrip.get_tabs().remove(selectedTab); 
tabStrip.commitChanges(); 
So assume this code has been executed and a == "NO".
(If a == "YES" then the tab is added and everything happens as expected.)
The problem is after I leave the tab I need an event to fire based on the tab I leave, but OnClientTabSelecting is giving me the wrong tab name.
function OnClientTabSelecting(sender, eventArgs) { 
    var selectedTab = sender.get_selectedTab().get_text(); 
    alert (selectedTab); 
So, in the case described above when I leave tab "Questions" OnClientTabSelecting will alert "References".
But, if the a == "YES", and therefore "StopOffs" is in the tabStrip and shown, then when I leave tab "Questions" OnClientTabSelecting will alert "Questions" like it is supposed to.
Also, if I never reach the function shown in the first code block (that is "StopOffs" tab was never added) then when I leave tab "Questions" OnClientTabSelecting will also alert "Questions" like it is supposed to.
Note: StopOffs tab is to the left of Questions tab. I don't know why it matters, but I add tabs to the right of Questions without an issue.
Thanks for any help.
Paul
Telerik team
 answered on 24 Sep 2009
2 answers
106 views
First let me explain my scenario:

I have a Default.aspx on which resides a PlaceHolder. I add user controls (ascx) to controls of PlaceHolder. On that user controls, i have RadGrids by which i insert/update/delete records. I popup another aspx from RadGrid to insert/update/delete records. When i insert/update/delete over this popup i use following codes:

on PopUp.aspx:

function

CloseAndRebind(args)

 

{

GetRadWindow().Close();

GetRadWindow().BrowserWindow.refreshGrid(args);  // refreshGrid here refers to  codes from which that popup is called(ascx)

}


on usercontrol.ascx:

 

function

 

 

refreshGrid(arg)

 

{

 

 

 

if(!arg)

 

{

$find(

 

 

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");

 

}

 

 

 

else

 

 

 

 

 

 

{

$find(

 

 

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");

 

}

}

on usercontrol.ascx.cs:

 

 

 

 

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)

 

{

 

 

 

if (e.Argument == "Rebind")

 

{

RadGridHizmetler.MasterTableView.SortExpressions.Clear();

RadGridHizmetler.MasterTableView.GroupByExpressions.Clear();

RadGridHizmetler.Rebind();

}

 

 

 

else if (e.Argument == "RebindAndNavigate")

 

{

RadGridHizmetler.MasterTableView.SortExpressions.Clear();

RadGridHizmetler.MasterTableView.GroupByExpressions.Clear();

RadGridHizmetler.MasterTableView.CurrentPageIndex = RadGridHizmetler.MasterTableView.PageCount - 1;

RadGridHizmetler.Rebind();

}

}

Popup is closed and (for instance) new record is inserted to the database. That is ok. However when i click nextpage or last page  of RadGrid(on ascx that has been added to control of PlaceHolder), RadGrid just disappears. When i  click  any page number nothing happens and when i click another page number(at the second try) RadGrid disappears again.

How can i resolve this?  Thanks...

 

 

 

 

 

 

Kem Arda
Top achievements
Rank 1
 answered on 24 Sep 2009
1 answer
261 views
When the calendar runs it default to the current month, I need to gain access to those dates... can someone point me in the right direction on where I can get the start and end date of that calendar.

Thanks so much
Peter
Telerik team
 answered on 24 Sep 2009
3 answers
144 views
Hi,

I've been evaluating the RadControls for ASP .NET, primarily the Grid control, for the last few weeks and posted a number of questions.  In most cases, I was able to get satisfactory answers...very nice.  Here's another question:

I have a parent grid with one detail grid.  I set scrolling as:

 

<Scrolling AllowScroll="True" UseStaticHeaders="True"

 

 

FrozenColumnsCount="6" SaveScrollPosition = "true" />

 


Scroll bar appears for the master grid.  However, when I open the detail grid from a row in the master grid, no scrollbar appears even though there are columns beyond the grid boundary.

Is there a way to make the detail grid scrollable as well?

Thanks.

Barry
Vlad
Telerik team
 answered on 24 Sep 2009
1 answer
237 views
I am looking at using a RadGrid to display a basic photo gallery. I have the grid configured, with a GridImageColumn showing a thumbnail image (from a file), along with a description. What I'd like to do is to either have the large version appear when the small image is clicked (or perhaps on hover?). I'd like to get something like the Lightbox javascript functionality, where the image appears in an overlay on the page.

Is this possible? Any suggestions? I can do this easily with a repeater and the lightbox script, but I am trying to use Telerik controls and wondering if I can do it with the grid.

TIA for any suggestions.
Yavor
Telerik team
 answered on 24 Sep 2009
1 answer
94 views
Hi,

We are trying to filter the recources in the scheduler.
But it is possible that the filter returns no recources, so the scheduler would be empty then.

Is there some kind op EmptyDataTemplate that we can show if there is no resource available?
Another problem is that we are getting some javascript errors when there is no recource.

Error message see following:  Link

Translation is : Runtime-fout Microsoft JScript: 'this._weekModels.0' is empty or not an object
Peter
Telerik team
 answered on 24 Sep 2009
1 answer
86 views
Hi there.
I was wondering if there is a way of skining a page view so it fits de radtabstrip that contains it (like drawing some borders similar to those drawn automatically when I add the fieldset tag in html, but that adjusts to the tab).
Cheers
Paul
Telerik team
 answered on 24 Sep 2009
1 answer
91 views
Is it possible to lock content layout. For example if I have a 2 divs one next to another  that I don’t want user to to delete div definitions  but add content inside of them  how do I do it.

For example
        <div id="wrap">  
            <div class="left">  
                User can add content Here  
            </div> 
            <div class="right">              
                User can add content Here  
            </div> 
        </div> 
Rumen
Telerik team
 answered on 24 Sep 2009
4 answers
235 views
I'm having trouble wrapping my head around how to implement something that I previously accomplished with a standard .Net DataGrid.  I've created a RadGrid control with a Master/Details table structure.  The detail columns include: ID, title, bReady, and bCompleted.  I want to programmatically check if bReady=false and if so set a hyperlink column to not be visible.  There are also some other pieces of logic I'd like to implement.

I tried using ItemDataBound of the Grid and OnDataBinding on the DetailsTable GridView, but nothing I've tried is working.

    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="lpu" 
        GridLines="None" Width="576px"
        <MasterTableView DataKeyNames="uid" DataSourceID="lpu" HierarchyLoadMode="ServerBind"
            <DetailTables> 
                <telerik:GridTableView DataKeyNames="esi" 
                    DataSourceID="lps" Width="100%" runat="server" CommandItemDisplay="None"  
                    HeaderStyle-Height="0"
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="eui" MasterKeyField="eui" /> 
                    </ParentTableRelation> 
                    <Columns> 
                        <telerik:GridBoundColumn SortExpression="esi" HeaderText="esi" 
                            DataField="esi" UniqueName="esi" Visible="false" 
                            ReadOnly="true"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="title" 
                            UniqueName="title"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="bReady" Visible="true" 
                            UniqueName="bReady"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="bCompleted" Visible="false" 
                            UniqueName="bCompleted"
                        </telerik:GridBoundColumn> 
                        <telerik:GridHyperLinkColumn DataNavigateUrlFormatString="javascript:launch('launch.aspx?esi={0}');" 
                            DataNavigateUrlFields="esi" DataType="Int32" Text="View"
                        </telerik:GridHyperLinkColumn> 
                    </Columns> 
 
<HeaderStyle Height="0px"></HeaderStyle> 
                </telerik:GridTableView> 
            </DetailTables> 
            <ExpandCollapseColumn Visible="True"
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="eui" DataType="System.Decimal" HeaderText="eui" 
                    ReadOnly="True" SortExpression="eui" UniqueName="eui" 
                    Visible="False"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="uo" DataType="System.Int32" HeaderText="uo" 
                    SortExpression="uo" UniqueName="uo" Visible="False"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="un" HeaderText="Name" SortExpression="un" 
                    UniqueName="un"
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
 

Can someone guide me on what I need to put into the ItemDataBound method to set up this behavior?  Here's where I've started but have gotten stuck.

Thanks

        if (e.Item is GridItem) 
        { 
            if (e.Item.OwnerTableView.ParentItem != null) 
            { 
                if (e.Item.OwnerTableView.DetailTables.Count > 0) 
                { 
                    foreach (GridTableView dt in e.Item.OwnerTableView.DetailTables ) { 
                        foreach (GridDataItem gdi in dt.Items) 
                        { 
                        } 
                    } 
                } 
            } 
        } 
 
Erik Willsey
Top achievements
Rank 1
 answered on 24 Sep 2009
17 answers
464 views
Hi,

Using 2008 Q3 SP2 (2008.3.1314.35), I build a RadGrid using :
   <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 

I've programmed a small helper class that basically localizes the RadGrid from a global resource file, but I've got two problems :

1) The pager is always reverted back to "NextPrev" when setting the localized text via "RadGrid.MasterTableView.PagerStyle", for example :
RadGrid.MasterTableView.PagerStyle.NextPagesToolTip = (string)HttpContext.GetGlobalResourceObject("RadGrid""MasterTableView_PagerStyle_NextPagesToolTip"); 

but is remains to "NextPrevNumericAndAdvanced" when setting via "RadGrid.PagerStyle", for example :
RadGrid.PagerStyle.NextPagesToolTip = (string)HttpContext.GetGlobalResourceObject("RadGrid""MasterTableView_PagerStyle_NextPagesToolTip"); 

Why is that ? Which one is the right one to use ?

2) The "Advanced" part cannot be localize using the same manner. I've found this old thread that mentions that you have to use the "RadGrid1_ItemCreated" event handler and set GoToPageLabel, GoToPageLinkButton, ChangePageSizeLabel and ChangePageSizeLinkButton. Is there a better way now ? It seems strange that everything else but that is so easily localizable...

Thanks for your help,

dstj.
Rini Boo
Top achievements
Rank 1
 answered on 24 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?