|
Thanks Roy and Stefan for your help.
Kyah
|
|
|
|
|
Hey,
I was wondering if this is a bug or it is supposed to work this way.
Yesterday i was playing with some controls on my windows .NET application.
On one form I have List view Control, but it is disabled. Now eventhough it is disabled it is firig its GetFocus event. I did not understand it. It wasnt firing Click event but just GetFocus and LostFocus. Other controls like textboxes or labels do not fire any events if they are disabled.
It puzzled me...
Thanks
Lav Pathak
Application Developer
Auxiliary Enterprises
Kalamazoo, MI
-- modified at 11:14 Wednesday 5th April, 2006
|
|
|
|
|
hi all,
I m working on a Data minning project using SQL Server and C#. and need code of k-means clustering algorithm implemented in c
#.
regards
|
|
|
|
|
|
i have my user control in namespace called Test1 my user control name is class Header. and i am trying to call that user control in my project number two which is called Test2. i have add reference in my Test2 and
using Test1;
namespace Test2
{
public class default : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Header proBarStatusUC = (Header) Page.FindControl("Header");
proBarStatusUC.Function1();
proBarStatusUC.Function2();
}//load
}//class
}//namespace
This work no problem, but when i try to LoadControl i get error 'file not found Header.ascx'.
using Test1;
namespace Test2
{
public class default : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Header proBarStatusUC = (Header) Page.FindControl("Header");
proBarStatusUC.Function1();
proBarStatusUC.Function2();
Header proBarStatusUC2 = (Header) Page.LoadControl("Header.ascx");
phPlaceHolder.Controls.Add(proBarStatusUC2);
}//load
}//class
}//namespace
if i have my user control in same namespace it worked, that not what i want. i what to call my user control in different project becuase my header will look same for the project and i don't want to create user control for every project. can someone please help me... Thank you,
|
|
|
|
|
I don't understand the <i>value and innertext </i> property of a XMLNode used in .NET.
Ex:
<xml>
<element>ABC</element>
<element>ABC</element>
</xml>
code:
XmlElement root = doc.DocumentElement;
XmlNodeList nodeList = root.ChildNodes;
Console.Write(nodeList[0].InnerText);
for (int i = 1; i < nodeList.Count; i++)
{
Console.Write(","+nodeList[i].InnerText);
}
nodelist[0].Value = "" => what is nodelist[0].value??
Please explain for me!!!
Hung
|
|
|
|
|
I'm sure not the expert, but what I found is that ABC is a child of the element node. To retrieve the value I use
val = node.FirstChild.Value;
try that.
|
|
|
|
|
Your program works when i run it...
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<xml>
<element>ABC</element>
<element>ABC</element>
</xml>");
XmlElement root = doc.DocumentElement;
XmlNodeList nodeList = root.ChildNodes;
Console.Write(nodeList[0].InnerText);
for (int i = 1; i < nodeList.Count; i++)
{
Console.Write(","+nodeList[i].InnerText);
}
Console.ReadLine();
}
}
/\ |_ E X E GG
|
|
|
|
|
Hello.
I might be wrong, but InnerText will take all the text inside a node.
for examlple
<xml>
<element1>
<element2>ABC</element2>
</element1>
</xml>
the InnerText of element1 will be "<element2>ABC</element2>"
while value will only fork for childnodes
could this be right ?
-- modified at 2:16 Friday 10th March, 2006
|
|
|
|
|
That is what InnerXml does. InnerText get the values of the node and all child nodes.
I'm not sure if it ignores white space if the node only contains white space and children. The InnerText of element1 will either be "ABC" or "\r\n ABC\r\n".
---
b { font-weight: normal; }
|
|
|
|
|
I want to connect C# with analysis services of MS SQL server 2000. I have a code and it is giving me the error:
Database <db-name> does not exists.
I want to access OLAP cube data from that database and retrieve the data from it to web.
I m using Windows XP SP2 and IIS server.
Please ans my question as fast as possible...
It's very urgent.
Waiting for reply......
Thanks in advance.
SWAROOP
|
|
|
|
|
hey guys dumb doubt.. i have developed a messenger on C# .. but Iam not able to create a form component in C# (am using .Net Framework 2.0)which can display my smileys.. can some one suggest a solution or provide me with the url for the code please.!! I want to know how to display smileys along with my text coz right now it just displays text and no pictures for smiley.. please help..
codecrammer - CRAM LORD!!
|
|
|
|
|
textBox1.Text += ":-)"; scnr
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
|
|
Hello every body i am sorry for this question but i am beginer in web developing and i don't get it how to edit dada in gridview in net 2.0
please if some body can help me.
good bye
best regars
down i apply the text
DataSet ds = new DataSet();
ds = SqlFunction.EditBook();
if (ds != null)
{
//
DataView dv = new DataView();
dv.Table = ds.Tables["Table"];
// string str = ds.Tables[0].TableName.ToString();
// HttpContext.Current.Trace.Write("Table name=",str);
/* DataGrid datagrid1 = new DataGrid();
datagrid1.DataSource = dv;
datagrid1.DataBind(); */
GridView1.DataSource = dv;
GridView1.DataBind();
}
else
{
HttpContext.Current.Trace.Write("Error in EditBook");
}
|
|
|
|
|
<%@ Import Namespace="System.Data" %>
DataView CartView;
Double runningTotal = 0;
//Cart is a property on the Page
DataTable Cart {
get {
if (Session["DGC_ShoppingCart"] == null) {
DataTable tmpCart = new DataTable();
tmpCart.Columns.Add(new DataColumn("Qty", typeof(string)));
tmpCart.Columns.Add(new DataColumn("Product", typeof(string)));
tmpCart.Columns.Add(new DataColumn("Price", typeof(Double)));
tmpCart.Columns.Add(new DataColumn("GiftWrap", typeof(bool)));
Session["DGC_ShoppingCart"] = tmpCart;
// first load -- prepopulate with some data
for (int i=1; i<=6; i++) {
DataRow dr = tmpCart.NewRow();
dr[0] = "1";
dr[1] = "Product " + i.ToString();
dr[2] = 1.23 * (i+1);
dr[3] = false;
tmpCart.Rows.Add(dr);
}
return tmpCart;
}
else
return (DataTable)Session["DGC_ShoppingCart"];
}
}
void Page_Init(Object sender, EventArgs e) {
MyDataGrid.EnableViewState=true;
}
void Page_Load(Object sender, EventArgs e) {
CartView = Cart.DefaultView;
if (!IsPostBack)
BindGrid();
}
void BindGrid() {
MyDataGrid.DataSource = CartView;
MyDataGrid.DataBind();
}
void btnUpdate_click(Object sender, EventArgs e) {
for (int i=0; i<MyDataGrid.Items.Count; i++) {
DataGridItem _item = MyDataGrid.Items[i];
TextBox qtyTextBox = (TextBox)_item.FindControl("txtQty");
CheckBox giftCheckBox = (CheckBox)_item.FindControl("chkGift");
// with a database, we'd use an update command.
// since this is an in-memory datatable, we'll just change the in-memory row.
DataRow dr = Cart.Rows[i];
dr[0] = qtyTextBox.Text;
dr[3] = giftCheckBox.Checked;
}
BindGrid();
}
Double CalcTotal (int count, Double price) {
Double total = count * price;
runningTotal += total;
return(total);
}
Custom Editing with DataGrid
<asp:datagrid id="MyDataGrid" runat="server"
="" bordercolor="black" borderwidth="1" gridlines="none" cellpadding="4" font-name="Verdana" font-size="8pt" headerstyle-backcolor="#aaaadd" autogeneratecolumns="false">
<columns>
<asp:templatecolumn headertext="Quantity">
<itemtemplate>
<asp:textbox id="txtQty" runat="server"
="" text="<%# DataBinder.Eval(Container, "DataItem.Qty") %>" width="40px">
<asp:boundcolumn headertext="Product" datafield="Product">
<asp:boundcolumn headertext="Price" datafield="Price" dataformatstring="{0:c}">
<asp:templatecolumn headertext="Gift Wrap?">
<itemtemplate>
<asp:checkbox id="chkGift" runat="server"
="" checked="<%# (bool)(((DataRowView)Container.DataItem)["GiftWrap"]) %>">
<asp:templatecolumn headertext="SubTotal">
<itemtemplate>
<asp:label runat="server"
="" text="<%# String.Format("{0:c}",CalcTotal((Int32.Parse((string)(((DataRowView)Container.DataItem)["Qty"]))),((Double)(((DataRowView)Container.DataItem)["Price"])))) %>">
<footertemplate>
<asp:label runat="server"
="" text="<%# String.Format("{0:c}", runningTotal) %></b>">
<asp:linkbutton id="btnUpdate" runat="server"
="" text="Update Totals" font-name="Verdana" font-size="8pt" onclick="btnUpdate_click">
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Console.Write(".............");
x = Console.Read();
Console.Write(".............");
y = Console.Read();
When using above code, the second Console.Read() has been done automatically caused by the "Enter key" of the first one.
How can I solve this problem? How can I clear buffer of keyboard??
Hung
|
|
|
|
|
|
I appreciate your solution, but I want to use the Console.Read() for some purposes.
Do you have others solution???????
Hung
|
|
|
|
|
Can anyone plz tell me where can i download "longhorn SDK" not Longhorn OS.
Plz give me any link if you have.
Thanks in advance
Sheel
Sheel Gohe
|
|
|
|
|
|
I am defining an interface to a real-time engine. Based on inputs to the engine the engine may fire events. How do I build the code so that the eventhandler is on the other side of the interface from the engine? That is, my subscriber(s) is external to the engine. Seems to me I have to declare something in the interface specification.
Thanks.
|
|
|
|
|
If you are already defining an interface, events arent necessary. You simply call the methods on the interface and let the implemeter handle them. IMO better than the event approach, and alot faster due to direct calls.
Events in an interface is normally so the interface can 'notify' to the interface user.
|
|
|
|
|
Consider this diagram:
user <- interface -> engine
Based on your last e-mail, the target of the event within the engine is on the interface. How is it that the user is notified?
|
|
|
|