I've run into a little problem on my side with the radtreeview. I'm trying to build a treeview based on a folder structure on a server that will allow an user to select which folders another user has access to. I can dymanically load everything and save just fine. The problem is when I come back to a new instance of the radtreeview, I have just the basic level node (in this case folder) and the tri-state is uncheked as it doesn't have any children yet (as expected because the tree doesn't know about the folders yet).
What's the best way to pre-load this list of existing checked boxes and still allow it to load the rest of the folders via ajax when the user clicks on the node. There are about 100 folders, each with about 50 subfolders which each contain another 10-50 subfolders (around 100k folders in total). Because of this, preloading will be painfully slow. The thing is that each user only has about access to 20 or so folders usually under one of the lower chains.
If someone has some sample code or ideas for pre-loading specific levels, including checking only those, and then fully populating when the expand a higher level I would greatly appreciate it. I do have a web service that returns the list of folders they have access to but I'm not sure of when/how I should call it in the scope of this.
For the loading the nodes via AJAX we use the code below (which is pretty much from the samples):
I figured I'd attempt to load the list of authorized folders in the load method (as show below) but that fails:
Actual Control:
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
CheckBoxes
=
"True"
TriStateCheckBoxes
=
"True"
OnClientLoad
=
"load"
OnClientNodeDataBound
=
"nodeDataBound"
OnClientNodePopulating
=
"nodePopulating"
OnClientNodeClicked
=
"nodeClicked"
OnClientNodePopulated
=
"nodePopulated"
Skin
=
"Outlook"
>
<
WebServiceSettings
Path
=
"~/Services/Directories.asmx"
Method
=
"GetDirectories"
/>
<
DataBindings
>
<
telerik:RadTreeNodeBinding
ImageUrlField
=
"ImageUrl"
TextField
=
"Text"
ValueField
=
"Value"
/>
</
DataBindings
>
</
telerik:RadTreeView
>
In a MVC view page, I set the data source of the Grid control.
I want to conditionally populate the cells based on the data in the server side of the view in C#. How do I populate it?
I used to do it in the ItemDataBound server side event. Is there any way I can loop throgh the datasource and declarativley define the ItemTemplate of the GridTemplateColumn? Please let me know how I can do conditional display in server side.
Thanks
<telerik:RadTextBox runat="server" ID="txtCompanyName" Text='<%#DataBinder.Eval(DataItem,"CompanyName") %>' Width="150px" TextMode="MultiLine"/>
instead of
<telerik:RadTextBox runat="server" ID="CompanyName" Text='<%#DataBinder.Eval(DataItem,"CompanyName") %>' Width="150px" TextMode="MultiLine"/>
Having a issue with getting the RadFileExplorer work with the example provided in http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/dbfilebrowsercontentprovider/defaultcs.aspx Following is the code used in my aspx file <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" Width="750px" Height="500px"
OnClientItemSelected="OnClientItemSelected"
Skin="Sitefinity">
<Configuration ViewPaths="~/Root/Default/ViewPath" UploadPaths="~/Root/Default/UploadPath"
DeletePaths="~/Root/Default/DeletePath" />
</telerik:RadFileExplorer> I have the ViewPaths, UploadPaths and DeletePaths set up in my solution as in the attached file (fileupload.png). The table structure is modeled according to the Items table with the addition of column CreatedBy. Have the following record in the Items table ItemID:1 Name: Root ParentID: NULL MimeType: NULL IsDirectory: True Size: NULL Content: NULL upsize_ts: NULL CreatedBy: nmarker Question 1: With the above setup I am unable to upload documents, or create Directories. Check file screenshot2.png My requirement is every logged in user to my website will have their own file structure defined in the DB. Have modified DataServer.csprivate DataTable Data
{
... SqlDataAdapter adapter = new SqlDataAdapter("SELECT ItemID, [Name], ParentID, MimeType, IsDirectory, [Size]FROM rbItems where CreatedBy='" + clsUtility.getLoggedInUserName() + "' ORDER BY ItemID", Connection);
...
}public byte[] GetContent(string path)Question 2: Can all logged in users share the same physical folder structure? as in fileupload.png? or should each user have their own folder structure defined? Please advise.
{
.. SqlCommand command = new SqlCommand("SELECT Content FROM rbItems WHERE ItemID = @ItemID AND CreatedBy = @CreatedBy", Connection);
...
}
public void CreateItem(string name, string path, string mimeType, bool isDirectory, long size, byte[] content)
{
.. SqlCommand command =
new SqlCommand(
"INSERT INTO rbItems ([Name], ParentId, MimeType, IsDirectory, [Size], Content, CreatedBy) VALUES (@Name, @ParentId, @MimeType, @IsDirectory, @Size, @Content, @CreatedBy)", Connection);
...
command.Parameters.Add(new SqlParameter("@CreatedBy", clsUtility.getLoggedInUserName()));
... }
var
gridRowParent = $(".rgRow").parent;
Is this even possible.
Next I want to get the height of the gridRowParent.
Any pointers greatly appreciated.