|
hi,
in my gridview i have some bound columns,and some template columns.and three columns dynamically added to the same gridview on the button click event.
code for dynamic created columns like this
For Each col As DataColumn In dtttt.Columns
For Each row As DataRow In dtt.Rows
If col.ColumnName = row.Item("CODE") Then
Dim customField1 As New TemplateField()
customField1.ShowHeader = True
customField1.HeaderTemplate = New Gridviewtemplate(DataControlRowType.Header, col.ColumnName, "", "label")
customField1.ItemTemplate = New Gridviewtemplate(DataControlRowType.DataRow, "", col.ColumnName, "Textbox")
DGV1.Columns.Add(customField1)
End If
Next
Next
DGV1.DataSource = dtttt
DGV1.DataBind()
but when the time of accessing the values of gridview except dynamically created template column values are not working
For i As Integer = 0 To DGV1.Rows.Count - 1
For count As Integer = 9 To DGV1.Columns.Count - 1
Try
dggrow = DGV1.Rows(i)
Select Case Incomes(Index)
Case 1
Earnings += CInt(dggrow.Cells(count).Text * Days)
Case 2
Earnings += CInt(dggrow.Cells(count).Text)
Case 3
Earnings -= CInt(dggrow.Cells(count).Text)
End Select
Catch ex As Exception
dggrow.Cells(count).Text = 0
End Try
Index += 1
Next
Next
dggrow.Cells(count).Text- here its not getting the value of dynamic created template column value.
how to access this value.anyone help me with this.this is very urgent.
|
|
|
|
|
Hi
As iam new to asp.net3.5 so i have some basic doubt please clarify my doubt with some example if possible,my question is WHAT IS THE USE OF DATA SOURCE,DATA BIND(),FILL(),DTATSET,DATAADPTER IN datagridview and how to use it.
|
|
|
|
|
Here's some advice.
1 - buy a book and read it
2 - learn to use google, especially when you have no idea what you're doing, because your questions right now are so basic and lacking in any sort of understanding, that you need to read articles, not forum replies
3 - before you post in a forum, read the guidelines.
your question tells me that you really have no idea about anything you're looking at. I'd assume that you're teaching yourself to be this lacking in resources, but experience tells me that the odds are good that someone is actually paying you to not know anything about ASP.NET. I hope that is not true. Either way, if you don't have a teacher, you need to buy a good book and work through it. I don't know if you know anything about programming, if you do not know C# or VB.NET, you should learn that first, because ASP.NET is a framework on top of .NET, and you should not learn both at the same time. Plenty of people try to do that, they end up asking clueless questions for hapless and eventually furious clients, whose projects never quite work, and are poorly written and unmaintainable.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If you google it, you'll get many good articles about all these stuff.
|
|
|
|
|
This commands are used to get data from database and bind it to gridview or other list controls.
|
|
|
|
|
lipun wrote: WHAT IS THE USE OF DATA SOURCE,DATA BIND(),FILL(),DTATSET,DATAADPTER IN datagridview and how to use it.
Using ADO.NET for beginners[^]
This will help you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
I am able to place the sharpmap on Google map in .net environment. But when i am porting it to the sharepoint environment it is not working(sharp map is not getting rendered). Any help?
|
|
|
|
|
i m taking three fields in database.like id,name,degination and .....etc others
but we want that when we show data according to these fields then allthree filds come in single dropdown
as 0111-vivek-developer.
how it is possible,plx help me soon.
thanks and regards
vivek
|
|
|
|
|
Why don't you use Grid instead? It doesn't look good in DropDownList.
|
|
|
|
|
The neatest way I can see is if you have a list of a struct, and the struct has a property which returns the three properties in the format you want.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
U can Do it in two ways u can directly retrive the data from the database in the form of store procedure
or
U can take the three fields i.e. id,name,degination from the database and while displaying u can combine them .
DropDownDrivers.DataSource = Reservation.GetDriver();
DropDownDrivers.DataTextField = "id"+"-"+"name"+"-"+"name";
DropDownDrivers.DataBind();
DropDownDrivers.Items.Insert(0, "Select");
and if u Insert the above data again u can use separotor operator as "-"
and u can take the value
string[] data1 = transkey1.Split('-');
string Id = data1[0].ToString();
string name = data1[1].ToString();
string delegation = data1[2].ToString();
If It Helps Let Me Know
|
|
|
|
|
Hi
I have implemented some drag n drop functionality using the example by WickedCode with their colour dragger, the dragging and dropping works perfectly however....
I have implemented a callback facility using so that when the user drops the object on its target I can perform the relevant update on the server refresh the screen and continue and this is where the problem lies. After the callback has completed my drag and drop no longer works!
I'm guessing it something to do with the Javascript code gaining a reference initially to the drag and drop objects but then when I perform the callback those objects get recreated within the updatepanel and although they have the same id the reference is obviously lost??
Has anybody got any references, links to helpful documentation on this subject as it seems quite sparse!
Thanks in advance
Andy
|
|
|
|
|
|
Hello friends,
I know i have posted similar thing yesterday but i didn't got my solution yet.
I am using popup window in my application which i am creating like this
<script type="text/javascript">
function Open() {
window.open('SearchBOM.aspx','myWin','scrollbars=no,width=500,height=500,resizable=no');
}
</script>
<a href="javascript:;" onClick="Open()">Search</a>
I want to pass a string value to my SearchBOM.aspx page, which i'll enter in a TextBox.
I tried using Session variables, but i found out on net that i can't use sessions in client side code.
Then i used HiddenField for the purpose but still it didn't helped me.
Now i want to try for QueryString option.
I know i have to pass it by putting '?' after pagename but it still giving me errors.
Am missing something? Can anybody help me?
Also i am using Content PAge and not a normal web page.
Thanks,
Nagendra.
|
|
|
|
|
You're still working on this?
<script type="text/javascript"><br />
function Open()<br />
{<br />
var uri = "SearchBOM.aspx?[param-name]=" + [value];<br />
window.open(uri,'myWin','scrollbars=no,width=500,height=500,resizable=no');<br />
}<br />
</script>
only two letters away from being an asset
|
|
|
|
|
Hey Thanks man, i combined the results mentioned by u and some other on net and i got it worked.
|
|
|
|
|
Dear Everybdy
i want to get only year of the system ,so plz help me.
thanks and regards
vivek sachan
|
|
|
|
|
It'll give u year of System Date
System.DateTime.Now.Year;
|
|
|
|
|
That will give you the year on the server. I assume he knows that, and wants the year on the client
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Christian How Can we get the client system date Without using Javascript
|
|
|
|
|
hello every one i am trying to make a method which takes vaolues of controls and insert those into database.
I am giving the code.
The error message is ==" memory allocation "
==============code of Function is====================================
string cmdtext = "CALL INSERT_PROCEDURE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
cmd = new OdbcCommand(cmdtext, con);
OdbcParameter p2 = new OdbcParameter("_section", OdbcType.VarChar,50);
p2.Value = @section ;
OdbcParameter p3 = new OdbcParameter("_Broad_Cat", OdbcType.VarChar,50);
p3.Value = @Broad_Cat;
OdbcParameter p4 = new OdbcParameter("_Cat", OdbcType.VarChar,50);
p4.Value = @Cat;
OdbcParameter p5 = new OdbcParameter("_Attribute1", OdbcType.VarChar,50);
p5.Value = @Attribute1;
OdbcParameter p6 = new OdbcParameter("_Attribute2", OdbcType.VarChar,50);
p6.Value = @Attribute2;
OdbcParameter p7 = new OdbcParameter("_Attribute3", OdbcType.VarChar,50);
p7.Value = @Attribute3;
OdbcParameter p8 = new OdbcParameter("_Attribute4", OdbcType.VarChar,50);
p8.Value = @Attribute4;
OdbcParameter p9 = new OdbcParameter("_Attribute5", OdbcType.VarChar,50);
p9.Value = @Attribute5;
OdbcParameter p10 = new OdbcParameter("_Loaction", OdbcType.VarChar,50);
p10.Value = @Location ;
OdbcParameter p11 = new OdbcParameter("_pincode", OdbcType.VarChar,50);
p11.Value = @Pincode;
OdbcParameter p12 = new OdbcParameter("_Locality", OdbcType.VarChar,50);
p12.Value = @Locality ;
OdbcParameter p13 = new OdbcParameter("_Description", OdbcType.VarChar,50);
p13.Value = @Description;
OdbcParameter p14 = new OdbcParameter("_Image", OdbcType.VarChar,50 );
p14.Value = @Image;
OdbcParameter p15 = new OdbcParameter("_Total_Char", OdbcType.VarChar,50);
p15.Value = @Total_Char ;
OdbcParameter p16 = new OdbcParameter("_Extra_Cha", OdbcType.VarChar,50);
p16.Value = @Extra_Char ;
OdbcParameter p17 = new OdbcParameter("_WebPage_Link", OdbcType.VarChar,50);
p17.Value = @Web_Link ;
OdbcParameter p18 = new OdbcParameter("_Email_id", OdbcType.VarChar,50);
p18.Value = @Email_Id;
OdbcParameter p19 = new OdbcParameter("_Total_Cost", OdbcType.VarChar,50);
p19.Value = @Total_Cost;
OdbcParameter p20 = new OdbcParameter("_Duration", OdbcType.VarChar,50);
p20.Value = @Duration;
OdbcParameter p21 = new OdbcParameter("_Status", OdbcType.VarChar,50);
p21.Value = @Status;
cmd.Parameters.Add(p2);
cmd.Parameters.Add(p3);
cmd.Parameters.Add(p4);
cmd.Parameters.Add(p5);
cmd.Parameters.Add(p6);
cmd.Parameters.Add(p7);
cmd.Parameters.Add(p8);
cmd.Parameters.Add(p9);
cmd.Parameters.Add(p10);
cmd.Parameters.Add(p11);
cmd.Parameters.Add(p12);
cmd.Parameters.Add(p13);
cmd.Parameters.Add(p14);
cmd.Parameters.Add(p15);
cmd.Parameters.Add(p16);
cmd.Parameters.Add(p17);
cmd.Parameters.Add(p18);
cmd.Parameters.Add(p19);
cmd.Parameters.Add(p20);
cmd.Parameters.Add(p21);
con.Open();
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
con.Close();
======================function is getting call here==============
CodeClass.insert_values(con, cmd, ddlSection.SelectedItem.Text, "employee", null, null, ddlJobType.SelectedItem.Text, ddlIndustry.SelectedItem .Text, null, null, ddlLocation2.SelectedItem.Text, ddlPincode2.SelectedItem.Text, ddlLocality2.SelectedItem .Text, txtDescription.Text, null, txtCalculator.Text, txtExtra.Text, txtweblink.Text, txtEmailId.Text, txtTotalCost.Text, ddlDuration.SelectedItem.Text, "Tempraroy");
|
|
|
|
|
|
This is really, really nasty.
The issue as far as I can see is that you have 21 ? and you're only adding 20 parameters. I'd suggest cleaning this code up.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i have a gridview using edittemplate i put it in a panel and use scroll bars. It doesnot work my gridview is hide when i put it in gridview, i also bring it in front but still hide.
help plz
|
|
|
|
|
Put your gridview inside div and set the overflow property of the div, also set height and width properties of the div.
HTH
|
|
|
|
|