Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
Hi I am getting this random error on radeditor. It only started when i upgraded to latest release. My custom EditorTool is showing Name on the editor instead of Text, which is very bizzar. Also I have installed new fonts in the machine and I want the editor to use those. But when I change the font to those fonts it changes back to time new roman although if i see in HTML its that font.

Can you please help me with this. I have a screenshot which I can send if you don't undertand the problem here.

Thanks
Atiq
Rumen
Telerik team
 answered on 29 Jul 2009
1 answer
171 views
Hi,
        I have created hierarchy grid as show in below. I am able to get the values of mastertabel in client side as shown below and i am not able to get the values of the row of the detail table in client side. My code is below , Please help me in this regards


 

function OpenRoom(spName,LabelName)

 

{

 

if (btnclick())

 

{

 

var Location=document.getElementById("ctl00$ContentPlaceHolder1$radTxtLocation").value;

 

 

var mode="New"//document.getElementById("ctl00$ContentPlaceHolder1$hdnMode").value;

 

 

var oWnd = radopen ("../Admin/LocationPopup.aspx?spName=" + spName +"&LabelName="+ LabelName+"&Location="+Location+"&Mode="+mode, null);

 

oWnd.set_title(

"One Intranet Corporation - " + LabelName);

 

oWnd.setSize (600, 400);

oWnd.Center();

}

}

 

 

function OpenZone(id, rowIndex)

 

{

 

var oWnd = radopen ("../Admin/LocationPopup.aspx?spName=sathiesZonesTranslationTableInsertOrUpdate&LabelName=Zone&RID="+id, null);

 

oWnd.set_title(

"One Intranet Corporation -Zones " );

 

oWnd.setSize (600, 400);

oWnd.Center();

 

}

 

 

function ShowZoneEditForm(id, rowIndex)

 

{

 

var grid = $find("<%= RadGrid1.ClientID %>");

 

 

 

// var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex];

 

 

 

 

var rowControl = grid.get_tableView();

 

 

alert(rowControl);

 

 

//grid.get_masterTableView().selectItem(rowControl, true);

 

 

var Zname = rowControl.getDataKeyValue("ZONENAME");

 

 

var TCode=rowControl.getDataKeyValue("TRANSLATEDCODE");

 

alert(Zname);

 

var Score=rowControl.getDataKeyValue("ZONESCORE") ;

 

 

var ZDate= rowControl.getDataKeyValue("ZONEVALIDTILL")

 

 

var ZTid= rowControl.getDataKeyValue("ZONETRANSLATEDID") ;

 

 

var Rid= rowControl.getDataKeyValue("ROOMID") ;

 

 

var oWnd = radopen ("../Admin/LocationPopup.aspx?spName=sathiesZonesTranslationTableInsertOrUpdate&LabelName=Zone&RID="+

 

Rid+

"&ZID="+id+"&TCode="+TCode+"&Mode=Edit&ZTID="+ZTid+"&ZoneName="+Zname+"&Score="+Score+"&Date="+ZDate, null);

 

oWnd.set_title(

"One Intranet Corporation - Room");

 

oWnd.setSize (600, 400);

oWnd.Center();

 

 

return false;

 

}

 

 

 

function ShowEditForm(id, rowIndex)

 

{

 

var grid = $find("<%= RadGrid1.ClientID %>");

 

 

 

var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex];

 

 

//grid.get_masterTableView().selectItem(rowControl, true);

 

 

var Rname = rowControl.getDataKeyValue("ROOMNAME");

 

 

var TCode=rowControl.getDataKeyValue("TRANSLATEDCODE");

 

 

// alert(TCode);

 

 

var Score=rowControl.getDataKeyValue("ROOMSCORE") ;

 

 

var RDate= rowControl.getDataKeyValue("ROOMVALIDTILL")

 

 

var RTid= rowControl.getDataKeyValue("ROOMTRANSLATEDID") ;

 

 

var Lid=document.getElementById("ctl00$ContentPlaceHolder1$hdnLocationID").value;

 

 

var Location=document.getElementById("ctl00$ContentPlaceHolder1$radTxtLocation").value;

 

 

var mode="Edit"//document.getElementById("ctl00$ContentPlaceHolder1$hdnMode").value;

 

 

var oWnd = radopen ("../Admin/LocationPopup.aspx?spName=RoomsTranslationTableInsertOrUpdate&LabelName=Room&Location="

 

+Location+

"&Mode="+mode+"&ID="+Lid+"&TCode="+TCode+"&RTID="+RTid+"&RoomName="+Rname+"&Score="+Score+"&Date="+RDate+"&RID="+id, null);

 

oWnd.set_title(

"One Intranet Corporation - Room");

 

oWnd.setSize (600, 400);

oWnd.Center();

 

 

return false;

 

}







 

<telerik:RadGrid ID="RadGrid1" OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand"

 

 

AutoGenerateColumns="false" PageSize="10" AllowPaging="true" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"

 

 

OnNeedDataSource="RadGrid1_NeedDataSource" runat="server">

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

<MasterTableView Name="Master" NoMasterRecordsText="No record" NoDetailRecordsText="No record"

 

 

ClientDataKeyNames="ROOMID,TRANSLATEDCODE,ROOMTRANSLATEDID,ROOMNAME,ROOMSCORE,ROOMVALIDTILL"

 

 

DataKeyNames="ROOMNAME,ROOMID,LOCATIONID,TRANSLATEDCODE,ROOMTRANSLATEDID,ROOMSCORE,ROOMVALIDTILL">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblRoom" runat="server" Text="Rooms"></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblRoomDs" runat="server" Text='<%#Eval("ROOMNAME") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblRoomScore" runat="server" Text='<%#Eval("ROOMSCORE") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblRoomDate" runat="server" Text='<%#Eval("ROOMVALIDTILL") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnEditRoom" runat="server" Text="Edit" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnDelRoom" runat="server" Text="Delete" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnAddZone"

 

 

runat="server" Text="Add Zone" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<DetailTables>

 

 

<telerik:GridTableView Width="100%" AutoGenerateColumns="false" HierarchyLoadMode="ServerOnDemand"

 

 

runat="server" Name="Detail1"

 

 

DataKeyNames="ZONENAME,TRANSLATEDCODE,ZONETRANSLATEDID, ZONEID,ROOMID,ZONESCORE,ZONEVALIDTILL"

 

 

ClientDataKeyNames="ZONENAME,ZONETRANSLATEDID,TRANSLATEDCODE, ZONEID,ROOMID,ZONESCORE,ZONEVALIDTILL">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblZones" runat="server" Text="Zones"></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblZonesDs" runat="server" Text='<%#Eval("ZONENAME") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblZoneScore" runat="server" Text='<%#Eval("ZONESCORE") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblZoneDate" runat="server" Text='<%#Eval("ZONEVALIDTILL") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnZoneEdit" CommandName="EditZones" runat="server" Text="Edit" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnZoneDel" runat="server" Text="Delete" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnAddElement"

 

 

runat="server" Text="Add Element" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<ParentTableRelation>

 

 

<telerik:GridRelationFields DetailKeyField="ROOMID" MasterKeyField="ROOMID" />

 

 

</ParentTableRelation>

 

 

<DetailTables>

 

 

<telerik:GridTableView Width="100%" HierarchyLoadMode="ServerOnDemand" runat="server"

 

 

Name="Detail2" DataKeyNames="ELEMENTNAME,TRANSLATEDCODE, ZONEID,ELEMENTID,ELEMENTSCORE,ELEMENTVALIDTILL"

 

 

ClientDataKeyNames="ELEMENTNAME,TRANSLATEDCODE, ZONEID,ELEMENTID,ELEMENTSCORE,ELEMENTVALIDTILL">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblElements" runat="server" Text="Elements"></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblElementDs" runat="server" Text='<%#Eval("ELEMENTNAME") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblElementScore" runat="server" Text='<%#Eval("ELEMENTSCORE") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblElementDate" runat="server" Text='<%#Eval("ELEMENTVALIDTILL") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnElementEdit" OnClientClick="openRadWindow('TranslationTableInsertOrUpdate','Elements','btnAddRoom'); return false;"

 

 

runat="server" Text="Edit" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<asp:Button ID="btnElementDel" runat="server" Text="Delete" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<ParentTableRelation>

 

 

<telerik:GridRelationFields DetailKeyField="ZONEID" MasterKeyField="ZONEID" />

 

 

</ParentTableRelation>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>


 

 

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridDataItem)

 

{

 

if (e.Item.OwnerTableView.Name == "Master")

 

{

 

Button editLink = (Button)e.Item.FindControl("btnEditRoom");

 

editLink.Attributes[

"href"] = "#";

 

editLink.Attributes[

"onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ROOMID"], e.Item.ItemIndex);

 

 

Button addLink = (Button)e.Item.FindControl("btnAddZone");

 

addLink.Attributes[

"href"] = "#";

 

addLink.Attributes[

"onclick"] = String.Format("return OpenZone('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ROOMID"], e.Item.ItemIndex);

 

}

 

if (e.Item.OwnerTableView.Name == "Detail1")

 

{

 

Button editLink = (Button)e.Item.FindControl("btnZoneEdit");

 

editLink.Attributes[

"href"] = "#";

 

editLink.Attributes[

"onclick"] = String.Format("return ShowZoneEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ZONEID"], e.Item.ItemIndex);

 

 

Button addLink = (Button)e.Item.FindControl("btnAddElement");

 

addLink.Attributes[

"href"] = "#";

 

addLink.Attributes[

"onclick"] = String.Format("return OpenElement('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ZONEID"], e.Item.ItemIndex);

 

}

 

 

 

}

}

 

 

protected void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)

 

{

 

if (e.DetailTableView.Name == "Detail1")

 

{

 

 

 

objSelectBL =

new SelectBL();

 

 

object[] arrSpParameters = new object[2];

 

arrSpParameters[0] =

Convert.ToInt32(hdnZoneID.Value==string.Empty?"0":hdnZoneID.Value);

 

arrSpParameters[1] =

"EN";

 

e.DetailTableView.DataSource = objSelectBL.Retrieve(

"FILLZONES", arrSpParameters);

 

}

 

if (e.DetailTableView.Name == "Detail2")

 

{

 

 

 

objSelectBL =

new SelectBL();

 

 

object[] arrSpParameters = new object[2];

 

arrSpParameters[0] = 1;

arrSpParameters[1] =

"EN";

 

e.DetailTableView.DataSource = objSelectBL.Retrieve(

"FILLELEMENT", arrSpParameters);

 

}

}

 

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

RadGrid sender = (RadGrid)source;

 

RadGrid1.ShowHeader =

false;

 

objSelectBL =

new SelectBL();

 

 

object[] arrSpParameters = new object[2];

 

arrSpParameters[0] =

Convert.ToInt32(hdnLocationID.Value);

 

arrSpParameters[1] =

"EN";

 

sender.DataSource = objSelectBL.Retrieve(

"FILLROOM", arrSpParameters);

 

 

 

 

 

}

Regards,

Sathies

Yavor
Telerik team
 answered on 29 Jul 2009
8 answers
376 views
Hi All,

I am currently using Rad Multicolumn Combobox.

The problem is when I set its selected index in my .vb (code behind) file

 Example: RadComboBox1.SelectedIndex = 2

The textbox ( of combobox) will not get populated with the appropriate value & even if I click on the dropdown the appropriate item will not be highlighted.

Any help regarding this will be appreciated. Thanks in advance.

Veselin Vasilev
Telerik team
 answered on 29 Jul 2009
3 answers
130 views
Am trying to create a popup "checkbox panel" - basically, when an icon is clicked, a popup comes up with my 30 data-bound checkboxes, arranged 5 per line (for 6 lines). Can I do this with a context menu or need to use a window control?
Yana
Telerik team
 answered on 29 Jul 2009
3 answers
229 views
How do I disable Template Manager from caching the files?

I added a save button in RadEditor, but Template Manager keeps reading the original file. Whenever I clear FF's cache, Template Manager inserts the correct files.
Lini
Telerik team
 answered on 29 Jul 2009
3 answers
178 views
Hello,

Please tell me what I'm doing wrong. I'm using the SearchPattern of an ImageManager, to limit the extensions to a folder.
I use the * character for easily recognizing extensions (*.jp*). This works for showing the files, but when I try to upload a file with extension .jpg, I get a message saying "The extension of the upload file is not valid. Please, provide a valid file!"

Here is my code:
RadEditor1.ImageManager.ViewPaths = new string[] { "~/Upload/Images" };  
RadEditor1.ImageManager.UploadPaths = new string[] { "~/Upload/Images" };  
RadEditor1.ImageManager.DeletePaths = new string[] { "~/Upload/Images" };  
RadEditor1.ImageManager.SearchPatterns = new string[] { "*.jp*", "*.gif", "*.png", "*.bmp" }; 

Any ideas?
Rumen
Telerik team
 answered on 29 Jul 2009
1 answer
87 views
Ok, this is really odd behavior. I'm running windows Vista with IE7 and the 2009.1 402 version of the RadControls.
 
I've got a page with a radsplitter with two panes; a left and a right. A rad treeview sits in the left pane which contains a bunch of links to local pages and when you left click on a treeview node the content loads in the right pane. I've set all of the RadTreeNodeBinding targets to the right pane's client id as seen below in the Page.Onload event. However we just noticed that if you right click a treeview node and select "Open in a new window" and then go to the new window that was opened and then navigate back to the main page that has the splitter/treeview then any node you click on will load the url in the entire window rather than just in the right pane. I've winmerged the source html between pages that exhibit the expected behavior and pages that show this un-expected behavior and there is no difference. My only conclusion is there is some sort of dynamic javascript used by the radtreeview and the splitter that has a defect.

 

foreach (RadTreeNodeBinding binding in TreeView2.DataBindings)

 

{

binding.Target = ContentPane.ClientID;

}

  1. Create and run a test project based on the info provided and left click on some links to confirm that the links open in the right pane.
  2. Right click a treeview node and select "open in a new window".
  3. Once the new window opens type in the url for the page from step one and navigate to it.
  4. Now left click any treeview node and see how the url no longer opens in the right pane, but rather navigates the entire window to the selected url which is not the expected behavior.

Veselin Vasilev
Telerik team
 answered on 29 Jul 2009
1 answer
125 views
Hi! I have a radgrid which has GridBinaryImage column and server side code to bind the data from the grid. My problem is I still can't display the image correctly in grid even if my image is byte[] type in c# and image type in sql db.

markup:

<

 

telerik:GridBinaryImageColumn DataField="PictureImg" HeaderText="Image" UniqueName="PictureImg"

 

 

ImageAlign="Middle" ImageHeight="200px" ImageWidth="200px" ResizeMode="Fit">

 

 

<HeaderStyle Width="10%" />

 


codebehind:

 

protected class PictureTemplate

 

{

 

public Guid PictureID { get; set; }

 

 

public string PictureName { get; set; }

 

 

public byte[] PictureImg { get; set; }

 

 

public string PictureDesc { get; set; }

 

}


 

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

 

List<PictureTemplate> picTemplate;

 

 

using (DianaOnlinePhotoEntities db = new DianaOnlinePhotoEntities())

 

{

picTemplate = (

from p in db.tblPicture

 

 

where p.PictureID != null

 

 

select new PictureTemplate

 

{

PictureID = p.PictureID,

PictureName = p.PictureName,

PictureImg = p.PictureImg,

PictureDesc = p.PictureDesc

}).ToList();

RadGrid1.DataSource = picTemplate;

}

}


Thanks!!
Vlad
Telerik team
 answered on 29 Jul 2009
2 answers
88 views
Hello Everybody

I'm using NeedDataSource event to populate grid with data. That's what grid tag looks like:

<telerik:RadGrid runat="server" ID="gridUsers" AutoGenerateColumns="false"  
        AllowPaging="true" AllowCustomPaging="true" 
        onneeddatasource="gridUsers_NeedDataSource" ShowStatusBar="true"  
        PageSize="25" onpageindexchanged="gridUsers_PageIndexChanged"  
        ondatabound="gridUsers_DataBound"> 
        <MasterTableView AllowFilteringByColumn="true"> 
            <PagerStyle Mode="Slider" /> 
            <Columns> 
                <telerik:GridTemplateColumn CurrentFilterFunction="StartsWith" ShowFilterIcon="false" AutoPostBackOnFilter="true" HeaderText="Username" SortExpression="Username"> 
                    <ItemTemplate> 
                        <a href="<%#UrlHelpers.GetUserProfileUrl(Eval("UserID")) %>"> 
                            <%#Eval("Username") %> 
                        </a> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn AllowFiltering="false" HeaderText="First name" DataField="FirstName"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn AllowFiltering="false" HeaderText="Last name" DataField="LastName"> 
                </telerik:GridBoundColumn> 
            </Columns>     
        </MasterTableView> 
    </telerik:RadGrid>  

That's a NeedDataSource event handler which I use:

protected void gridUsers_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        using (DataClassesDataContext db = new DataClassesDataContext())  
        { 
            var query = from c in db.Users  
                        select  
                        new  
                        { 
                            c.FirstName,   
                            c.LastName, 
                            c.Username, 
                            c.UserID 
                        }; 
            gridUsers.MasterTableView.VirtualItemCount = query.Count(); 
            gridUsers.DataSource = query.Skip(gridUsers.CurrentPageIndex*gridUsers.PageSize).Take(gridUsers.PageSize).ToList(); 
        } 
    } 
 
I feel confused, because nearly all live demos that illustrate filtering stuff use SqlDataSource for data binding, not NeedDataSource handling. Every time I try to filter the grid by username I get an error which says "Expression expected". Could anybody give me a tip that would help me to solve the issue without changing the way data binding is done?

Thanks in advance!  
vo_one
Top achievements
Rank 1
 answered on 29 Jul 2009
1 answer
110 views
Hi
     I Used RadGrid. Herewith i have load 1000 Records. Each Page Index Shows 25 Records. it is Working Properly. When i saw the View Source the Record Showing only 25 Records(view Html Source) it is good. But The Same way i used to Another Grid But the View Source Shows the 1000 Records in Html View. In order that the Gird page is Loding Slowely. I don't know.. Why One Grid View Source is displaying Corretly.. and Another one is Wrong... Let me know how can i solved this problem...Herewith i have give my sample Coding here.


This Grid Html View is Showing Properly...

HTML
 <JetSoft:RadGrid ID="griduniversal" TabIndex="1190"   AllowPaging="True"
                            OnNeedDataSource="griduniversal_NeedDataSource" OnPageIndexChanged="griduniversal_PageIndexChanged" Width="100%" OnEditCommand="griduniversal_EditCommand"  AlternatingItemStyle-BackColor="ActiveBorder"                             
                            OnPreRender="griduniversal_PreRender"  AutoGenerateColumns="False"  
                            runat="server"  GridLines="None" AllowSorting="True">
                           
                                    <HeaderContextMenu EnableTheming="True">
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                    </HeaderContextMenu>
                                    
                                     <ClientSettings>
                                        <Selecting AllowRowSelect="true" />
                                    </ClientSettings>
                                     <MasterTableView  CommandItemDisplay="Top"  DataKeyNames="id,ContactTypeID">                                     
                                    
                                    
                                    <CommandItemTemplate>
                                     <div class="deletelnk">
                                        <asp:LinkButton ID="lnkContactDelete"  OnClick="lnkContactDelete_OnClick" OnClientClick="javascript:return confirm('Would you like to delete the selected Contact(s)?')" runat="server" CausesValidation="false"><img style="border:0px;vertical-align:middle;" alt="" src="../../Images/Delete.png" /><asp:Literal ID="litDeleteArea" runat="server" Text="<%$ Resources:AdminResource, lnkDeleteContact%>"></asp:Literal></asp:LinkButton>
                                     </div>  
                                 </CommandItemTemplate>      
                                                                        
                             <Columns>
                                    
                                    <JetSoft:GridTemplateColumn UniqueName="TemplateColumn">
                                    <ItemTemplate>                    
                                            <asp:CheckBox id="chkContactDelete" runat="server"></asp:CheckBox>                  
                                    </ItemTemplate>
                                    <HeaderStyle Width="10px"></HeaderStyle>                                
                                    </JetSoft:GridTemplateColumn>        
                                
                                      <JetSoft:GridEditCommandColumn UniqueName="EditCommandColumn">
                                      <HeaderStyle Width="40px"></HeaderStyle>
                                       </JetSoft:GridEditCommandColumn>                                            
                                       
                                        <JetSoft:GridBoundColumn UniqueName="ID" Visible="false" HeaderText="ID" DataField="ID">
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        </JetSoft:GridBoundColumn>           
                                      
                                      <JetSoft:GridBoundColumn UniqueName="FirstName"  HeaderText="Name" DataField="FullName">
                                        <HeaderStyle Width="300px"></HeaderStyle>
                                      </JetSoft:GridBoundColumn>
                                      
                                      <JetSoft:GridBoundColumn UniqueName="City"  HeaderText="City" DataField='CityName'>
                                        <HeaderStyle Width="200px"></HeaderStyle>
                                      </JetSoft:GridBoundColumn>
                                      
                                      <JetSoft:GridBoundColumn UniqueName="State" HeaderText="State" DataField="StateName">
                                        <HeaderStyle Width="100px" />
                                      </JetSoft:GridBoundColumn>
                                      
                                      <JetSoft:GridBoundColumn UniqueName="Description" HeaderText="Contact Type" DataField="ContactDescription">
                                      </JetSoft:GridBoundColumn>                                                                          
                                          
                                 </Columns>
                         
                                        <EditFormSettings EditFormType="WebUserControl">
                                        <EditColumn>
                                        </EditColumn>
                                        </EditFormSettings>
                                       
                                        <RowIndicatorColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>

                                        <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>
                                        </MasterTableView>

                                        <FilterMenu EnableTheming="True">
                                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                        </FilterMenu>
                                        
                                </JetSoft:RadGrid>

Code Behind Part
 /// <summary>
        /// Handling PreRender Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        ///
        protected void griduniversal_PreRender(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {

                if (JSSessionHandler.GetSessionValue("ImageUploadID") != null)
                {
                    if (JSSessionHandler.GetSessionValue("ImageUploadID").ToString() == "OutSideVendorImageUploaded")
                    {                      
                       // To do Something
                        this.griduniversal.MasterTableView.Rebind();
                      
                    }
                    else if (JSSessionHandler.GetSessionValue("ImageUploadID").ToString() == "OutSideVendorLeadImageUploaded")
                    {
                                               // To do Something
                        this.griduniversal.MasterTableView.Rebind();                       
                    }

                }
                else
                    griduniversal.CurrentPageIndex = Convert.ToInt32(JSSessionHandler.GetSessionValue("gridPageIndex"));
                this.griduniversal.MasterTableView.Rebind();
            }
        }


Need Data Source
        protected void griduniversal_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            
            if (JSSessionHandler.GetSessionValue("sessionSearchcontacts") == null)
            {
                if ((txtUniversalSearchFirstName.Text == string.Empty) && (txtUniversalSearchLastName.Text == string.Empty) && (txtUniversalSearchEmail.Text == string.Empty) && (txtUniversalSearchPostalZipCode.Text == string.Empty))
                {
                    if (Request.QueryString["contactID"] != null && Request.QueryString["contactID"] != "")
                    {
                           // TODO: Something Here
                        List<ContactData> gridData = new List<ContactData>();
                        gridData = contactManager.GetGridContactByID(Convert.ToInt32(Request.QueryString["contactID"]));
                        this.griduniversal.DataSource = gridData;                      
                    }
                    else
                    {

                        List<ContactData> gridData = new List<ContactData>();
                        UserData sessionUser = (UserData)JSSessionHandler.GetSessionValue("UserData");
                        if (sessionUser != null && sessionUser.Id > 0)
                        {
                           // TODO: Something Here
                            gridData = contactManager.GetAllSearchContacts(Convert.ToInt32(sessionUser.Id));
                            this.griduniversal.DataSource = gridData;
                           
                        }
                      

              
The below sample coding  Grid view HTML is wrong.

   <JetSoft:RadGrid ID="gridPropertySearch" AllowPaging="True"
                            OnNeedDataSource="gridPropertySearch_NeedDataSource"  
                        OnEditCommand="gridPropertySearch_EditCommand" Width="100%" OnPageIndexChanged="gridPropertySearch_PageIndexChanged"  AlternatingItemStyle-BackColor="ActiveBorder"                             
                            OnPreRender="gridPropertySearch_PreRender"  AutoGenerateColumns="False"
                            runat="server"  GridLines="None" AllowSorting="True">
                            
                     <HeaderContextMenu EnableTheming="True">
                   <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                    </HeaderContextMenu>
                
                <ClientSettings>
                <Selecting AllowRowSelect="true" />
                </ClientSettings>
                
                        <AlternatingItemStyle BackColor="ActiveBorder" />
                
                <MasterTableView   CommandItemDisplay="Top" DataKeyNames="ID">                                  
                   
                 
                     <CommandItemTemplate>
                     <div class="deletelnk">
                     <asp:LinkButton ID="lnkPropertyDelete" OnClientClick="javascript:return confirm('Would you like to delete the selected Propertie(s)?')" OnClick="lnkPropertyDelete_Click" runat="server" CausesValidation="false"><img style="border:0px;vertical-align:middle;" alt="" src="../../Images/Delete.png" /> <asp:Literal ID="litDeleteArea" runat="server" Text="<%$ Resources:AdminResource, lnkDeleteProperty%>"></asp:Literal></asp:LinkButton>
                     </div>                      
                  </CommandItemTemplate>                
                 
                  <Columns>                                          
                    <JetSoft:GridTemplateColumn UniqueName="TemplateColumn">
                    <ItemTemplate>                    
                       <asp:CheckBox id="chkPropertiesDelete" runat="server"></asp:CheckBox>                                                                                                                
                    </ItemTemplate>
                    <HeaderStyle Width="5px"></HeaderStyle>
                    </JetSoft:GridTemplateColumn>                                       
                                                                                                           
                    <JetSoft:GridEditCommandColumn UniqueName="EditCommandColumn">
                    <HeaderStyle Width="10px"></HeaderStyle>
                    </JetSoft:GridEditCommandColumn>                          
                    
                    <JetSoft:GridBoundColumn Visible="false"  UniqueName="ID" HeaderText="ID" DataField="ID">
                    <HeaderStyle Width="70px"></HeaderStyle>
                    </JetSoft:GridBoundColumn>    
                    <JetSoft:GridBoundColumn UniqueName="Code" HeaderText="Code" DataField="Code">
                    <HeaderStyle Width="25px"></HeaderStyle>
                    </JetSoft:GridBoundColumn>    
                                                                                                                                                                                                    
                    <JetSoft:GridBoundColumn UniqueName="Name" HeaderText="Property Name" DataField="Name">
                    <HeaderStyle Width="70px"></HeaderStyle>
                    </JetSoft:GridBoundColumn>                     
                    
                    <JetSoft:GridBoundColumn UniqueName="DestinationName" HeaderText="Area Name" DataField="DestinationName">
                    <HeaderStyle Width="70px"></HeaderStyle>
                    </JetSoft:GridBoundColumn>                     
                                                                                                                                                                                                                                    
                  </Columns>
                
                  <EditFormSettings EditFormType="WebUserControl">
                  <EditColumn>
                  </EditColumn>
                  </EditFormSettings>
                  
                  <RowIndicatorColumn>
                  <HeaderStyle Width="20px"></HeaderStyle>
                  </RowIndicatorColumn>
 
                  <ExpandCollapseColumn>
                  <HeaderStyle Width="20px"></HeaderStyle>
                  </ExpandCollapseColumn>
                  </MasterTableView>

                  <FilterMenu EnableTheming="True">
                  <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                  </FilterMenu>                                                                                

                            
                    </JetSoft:RadGrid>


/// <summary>
        /// Handling PreRender Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        ///
        protected void gridPropertySearch_PreRender(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {

                if (JSSessionHandler.GetSessionValue("EditImageUploadID") != null)
                {
                    int itemvalue;
                    if (Request.QueryString["propertyImagesID"] != "" && Request.QueryString["propertyImagesID"].ToString() != "")
                    {
                        JSSessionHandler.SetSessionValue("PropertyBedLayout", "1");
                        itemvalue = Convert.ToInt32(Request.QueryString["propertyImagesID"]);
                    }
                    else
                    {
                        JSSessionHandler.SetSessionValue("PropertyBedLayout", "1");
                        itemvalue = Convert.ToInt32(JSSessionHandler.GetSessionValue("propertyImagesID").ToString());
                    }
                    gridPropertySearch.MasterTableView.EditFormSettings.UserControlName = "~/Admin/UserControl/PropertySearchEx.ascx";
                    this.gridPropertySearch.MasterTableView.Items[itemvalue].Edit = true;
                    this.gridPropertySearch.MasterTableView.Rebind();
                    JSSessionHandler.SetSessionValue("PropertyId", JSSessionHandler.GetSessionValue("PropertyId"));
                }
                else                
                    this.gridPropertySearch.MasterTableView.Rebind();
                
                 
            }
        }


 /// <summary>
        /// Loads the data source
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void gridPropertySearch_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {

            if (JSSessionHandler.GetSessionValue("GetInsertedPropertyId") != null)
            //if (Request.QueryString["propertyID"] != null && Request.QueryString["propertyID"] != "")
            {
                IList<PropertyData> gridPropertyData = new List<PropertyData>();
                gridPropertyData = propertyManager.GetInsertedPropertybyId(Convert.ToInt64(JSSessionHandler.GetSessionValue("GetInsertedPropertyId")));
                this.gridPropertySearch.DataSource = gridPropertyData;
                // JSSessionHandler.RemoveSessionKey("GetInsertedPropertyId");

            }

            else if (JSSessionHandler.GetSessionValue("GetUpdatedPropertyId") != null)
            //(Request.QueryString["UpdatepropertyID"] != null && Request.QueryString["UpdatepropertyID"] != "")
            {

                IList<PropertyData> gridPropertyData = new List<PropertyData>();
                gridPropertyData = propertyManager.GetInsertedPropertybyId(Convert.ToInt64(JSSessionHandler.GetSessionValue("GetUpdatedPropertyId")));
                this.gridPropertySearch.DataSource = gridPropertyData;
                //JSSessionHandler.RemoveSessionKey("GetUpdatedPropertyId");
               

            }
            else
            {

                if ((txtSearchPropertyName.Text == string.Empty) && (txtSearchPropertyOwner.Text == string.Empty))
                {                 


                    IList<PropertyData> gridPropertyData = new List<PropertyData>();
                    // gridPropertyData = propertyManager.GetAllSearchProperties();
                    IList<ContactData> gridData = new List<ContactData>();
                    UserData sessionUser = (UserData)JSSessionHandler.GetSessionValue("UserData");
                    //gridPropertyData = propertyManager.GetAllUserWiseSearchProperties(Convert.ToInt32(sessionUser.Id));

                    if (sessionUser != null && sessionUser.Id > 0)
                    {
                        DateTime sDate = DateTime.Now;
                        gridPropertyData = propertyManager.GetAllUserWiseSearchPropertiesEx(Convert.ToInt32(sessionUser.Id));
                        DateTime edate1 = DateTime.Now;
                        TimeSpan ts8 = sDate - edate1;

                        this.gridPropertySearch.DataSource = gridPropertyData;
                    }
                    else
                    {
                        Server.Transfer("~/Default.aspx");
                    }

                }
           
            }

Let me  know How can i solved this problem.... Please Do need ful ASAP





           








Vlad
Telerik team
 answered on 29 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?