Click here to Skip to main content
15,886,362 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: HttpContext values are lost during AJAX call after Adding masterpage Pin
Albert8317-Aug-13 17:08
Albert8317-Aug-13 17:08 
QuestionThe file you are trying to open,XXXX,is in different format than specified by the file extension Pin
Jimmiraghu13-Jul-13 2:23
Jimmiraghu13-Jul-13 2:23 
AnswerRe: The file you are trying to open,XXXX,is in different format than specified by the file extension Pin
Bernhard Hiller14-Jul-13 21:58
Bernhard Hiller14-Jul-13 21:58 
Questionsample projects required Pin
ppayal12-Jul-13 20:29
ppayal12-Jul-13 20:29 
AnswerRe: sample projects required Pin
Richard MacCutchan12-Jul-13 22:19
mveRichard MacCutchan12-Jul-13 22:19 
QuestionExport to excel /xlsx file Pin
Ballita12-Jul-13 1:53
Ballita12-Jul-13 1:53 
AnswerRe: Export to excel /xlsx file Pin
ZurdoDev12-Jul-13 7:25
professionalZurdoDev12-Jul-13 7:25 
Questionimage icon should display from data base on leftside of treeview. Pin
christhuxavier11-Jul-13 3:15
christhuxavier11-Jul-13 3:15 
I have created a treeview, which is binding categories and subcategories from database.

I want to display an icon (image) on left side of the treeview. For example, in treeview I have categories such as amana tool as a parent node and the router bits as child node of amana tool. So, in database I have icon of amana tool as well as icon of router bits. Now, I am able to show categories (amana tool) only in treeview. But, I need that left side should show the icon of the related categories and then categories name(amana tool).


Note: The icon should bind from database but it should not be static icon because I need to show more than 100 categories and the icon existing in database.

Please help me out.






Here my code works correctly , further what i have to do?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace ShopGear1.View
{
public partial class treefin : System.Web.UI.Page
{
private string scon = "";
protected void Page_Load(object sender, EventArgs e)
{
scon = " connection string";
ModuleTreeView.CollapseAll();


FillTreeView();
}
public DataTable GetModuleDetails()
{
using (SqlConnection conn = new SqlConnection(scon))
{
string sql = "sql query";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
public void FillTreeView()
{
DataTable modules = new DataTable();
modules = GetModuleDetails();
ModuleTreeView.Nodes.Clear();

PopulateTreeNode(modules, null, 0);
}
private void PopulateTreeNode(DataTable modulelist, TreeNode parent, int parentid)
{
TreeNodeCollection baseNodes;
TreeNode node;
if (parent == null)
{
baseNodes = ModuleTreeView.Nodes;
}
else
{
baseNodes = parent.ChildNodes;
}
foreach (DataRow dtrow in modulelist.Rows)
{
if (int.Parse(dtrow["parent_orid"].ToString()) == parentid)
{
node = new TreeNode();

node.Text = dtrow["descript"].ToString();
node.Value = dtrow["code_webcategory_id"].ToString();
node.SelectAction = TreeNodeSelectAction.Select;
baseNodes.Add(node);
PopulateTreeNode(modulelist, node, int.Parse(dtrow["code_webcategory_id"].ToString()));

}



}
ModuleTreeView.CollapseAll();
}
}
}
AnswerRe: image icon should display from data base on leftside of treeview. Pin
jkirkerx11-Jul-13 11:58
professionaljkirkerx11-Jul-13 11:58 
QuestionSelect Excel File as Database table in runtime - ASP.Net - C# Pin
SravanKumar-A11-Jul-13 2:51
SravanKumar-A11-Jul-13 2:51 
AnswerRe: Select Excel File as Database table in runtime - ASP.Net - C# Pin
chester_it2111-Jul-13 8:59
chester_it2111-Jul-13 8:59 
QuestionMigration from google calendar V2 to V3 Pin
Er Himanshu Jain11-Jul-13 2:13
Er Himanshu Jain11-Jul-13 2:13 
AnswerRe: Migration from google calendar V2 to V3 Pin
Richard MacCutchan11-Jul-13 2:27
mveRichard MacCutchan11-Jul-13 2:27 
AnswerRe: Migration from google calendar V2 to V3 Pin
Er Himanshu Jain11-Jul-13 2:34
Er Himanshu Jain11-Jul-13 2:34 
GeneralWSDL issues Pin
asv10-Jul-13 22:48
asv10-Jul-13 22:48 
SuggestionRe: WSDL issues Pin
Richard MacCutchan10-Jul-13 23:13
mveRichard MacCutchan10-Jul-13 23:13 
GeneralRe: WSDL issues Pin
jkirkerx12-Jul-13 7:12
professionaljkirkerx12-Jul-13 7:12 
QuestionWebServices Encoding Problem Pin
asv10-Jul-13 11:25
asv10-Jul-13 11:25 
AnswerRe: WebServices Encoding Problem Pin
jkirkerx12-Jul-13 7:26
professionaljkirkerx12-Jul-13 7:26 
Questionerror in add extensions to dotnetnuke Pin
mit6210-Jul-13 1:00
mit6210-Jul-13 1:00 
SuggestionRe: error in add extensions to dotnetnuke Pin
ZurdoDev10-Jul-13 9:00
professionalZurdoDev10-Jul-13 9:00 
Questionswipe the gridview content Pin
sk_ko9-Jul-13 21:51
sk_ko9-Jul-13 21:51 
Questionrich text editor Pin
blachsmith9-Jul-13 16:00
blachsmith9-Jul-13 16:00 
QuestionDisplaying Database Pin
Athul Tuttu Baby9-Jul-13 7:33
Athul Tuttu Baby9-Jul-13 7:33 
QuestionRe: Displaying Database Pin
ZurdoDev10-Jul-13 9:01
professionalZurdoDev10-Jul-13 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.