|
|
You Can Use "CollapsiblePanelExtender" inside Listview for expand and collapse
Below code.
<asp:ListView ID="ListView1" runat="server"
onitemdatabound="ListView1_ItemDataBound1">
<LayoutTemplate>
<table border="0" cellpadding="3" cellspacing="0" width="97%">
<tr >
<td width="15%">
Col one</td>
<td width="15%">
Grid Column</td>
</tr>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr >
<td>
<asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label>
</td>
<td>
<asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton>
<asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton>
<asp:Label ID="Label3" runat="server" Text="panel"></asp:Label>
<asp:Panel ID="pnl1" runat="server" >
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Department" DataField="Department" />
</Columns>
</asp:GridView>
</asp:Panel>
<cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True">
</cc1:CollapsiblePanelExtender>
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr >
<td>
<asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label>
</td>
<td>
<asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton>
<asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton>
<asp:Label ID="Label3" runat="server" Text="panel"></asp:Label>
<asp:Panel ID="pnl1" runat="server" >
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Department" DataField="Department" />
</Columns>
</asp:GridView>
</asp:Panel>
<cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True">
</cc1:CollapsiblePanelExtender>
</td>
</tr>
</AlternatingItemTemplate>
</asp:ListView>
And change to item databound will be as follow
protected void ListView1_ItemDataBound1(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Panel pnl = (Panel)e.Item.FindControl("pnl1");
if (pnl != null)
{
GridView Grd = pnl.FindControl("GridView1") as GridView;
if (Grd != null)
{
clsDepartment dpt = new clsDepartment();
Grd.DataSource = dpt.SelectAll();
Grd.DataBind();
}
}
}
}
Now Apply Images and Styles yourself
|
|
|
|
|
Thanks Zafar.
It's working fine.
Thanks a lotttt.
|
|
|
|
|
Hello,
I am having a table in my databse with columns
ACCOUNT_CODE NARRATION
i filled dropdown list with account code values from the database.
now my question is:
when i select the p[articular item in the dropdown list,
the narration textbox must be filled from the database based on the
selected item.
Plz,help me....
Thanks in advance
|
|
|
|
|
Did you struck somewhere ? You said you have added values from the database to dropdownlist.
In DropDownList1_SelectedIndexChanged event, you can write code for creating textbox dynamically, bind it with database value and add it to the form.
Dim txt As New TextBox()
txt.Text = "Sample value from the database"
Me.form1.Controls.Add(txt)
Make the controls AutoPostBack property as "True".
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I use passwordstrength control in my project.But when I run the page an error occure that Type 'AjaxControlToolkit.PasswordStrength' does not have a public property named 'StrengthStyles'..Please give me a solution as early as possible
Thanks & Regards
m_k
|
|
|
|
|
Take and read this article[^].
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
try the following. i have tested but do not get any error.
but text in "TextStrengthDescriptions" should be equal to the styles specified in "StrengthStyles"
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:PasswordStrength TargetControlID="TextBox1" PreferredPasswordLength="10" TextStrengthDescriptions="very Poor;weak;Average;strong" StrengthStyles="cls1;cls2;cls3;cls4" PrefixText="Strength : " StrengthIndicatorType="text" ID="PasswordStrength1" runat="server">
</cc1:PasswordStrength>
if do not work then check your web.config have you added the following in <system.webserver> section
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
|
|
|
|
|
Still I hve the same error. My code is here
ajaxToolkit:PasswordStrength runat="server" ID="PasswordStrength1" TargetControlID="Password" DisplayPosition="RightSide" PreferredPasswordLength="5" CalculationWeightings="25;25;15;35" RequiresUpperAndLowerCaseCharacters="true" TextStrengthDescriptions="Poor; Weak; Good; Strong; Excellent" HelpStatusLabelID="lblhelp" StrengthIndicatorType="BarIndicator"
HelpHandlePosition="AboveLeft"
BarBorderCssClass="barIndicatorBorder" StrengthStyles="barIndicator_poor; barIndicator_weak; barIndicator_good; barIndicator_strong; barIndicator_excellent">
Thanks
|
|
|
|
|
post your code please
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
how to update a multiple tables in a gridview
|
|
|
|
|
haleemasher wrote: how to update a multiple tables in a gridview
How do I guess what you exactly wanna do?
Jokes apart, could you explain what you wanna do.
First of all there are no multiple tables in gridview.
Secondly, do you want to update the grid view with result which is composition of multiple tables?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i have a gridview which contains data from two tables now i would like to update that record. this record doesnot contain any primary key.
i need asp code to bind that data with gridview.
<asp:TemplateField HeaderText="Recieved By" SortExpression="Recieved_By">
<EditItemTemplate>
<asp:TextBox ID="txtby" Width="100px" runat="server" Text='<%# Bind("[Coupon_Info.Recieved_By]") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate >
<asp:Label ID="lblby1" Width="100px" runat="server" Text='<%# Bind("[Coupon_Info.Recieved_By]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField> i have done this but it doesn't work.
|
|
|
|
|
haleemasher wrote: how to update a multiple tables in a gridview
What does it mean? Do you have multiple table associated the DataSource of Grid and you want to Update ?
|
|
|
|
|
yes i have multiple tables associated with the datasource of gridview and i want to update that record
|
|
|
|
|
Good Morning haleemasher
In my early days of Programming i used to write my application using all this sorts of wizards it was great and i enjoyed it and forgot that i had to write code sometimes, but the wizards did everything for me. In my Applications there was a time where i needed to update data from a Join Now there is a limitation for Wizards , they dont know which table to update or wich field even though it looked obvious to you what table to update. This leads me to the World of N-Tier Development where i had to Start Writting my own DAL(Data Access Layer) and update the Grid. Am sorry to say this , this means you have to write your own Data layer and update the grid and the Correct table , because the SqlDatasource wizards cannot do it for you in this case. i have articles that i wrote when i had a problem see below
Coding an N-Tier Application in C# Without Any Wizard: Part II[^]
Good Luck
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hello
i want to display value of gridview row in another page having label give me solution
|
|
|
|
|
Member 4480959 wrote: i want to display value of gridview row in another page having label give me solution
On GridViewSelected Index Changed Event, Read the Selected Row in object of GridViewRow Class. Then Store the Object in Session and Access from Next Page.
|
|
|
|
|
Pass the value through URL as query string. In the second page, you can read this and display on the label.
|
|
|
|
|
Very good article for you.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi ,
i have used a Regular expression to validate the textbox to number format.
<asp:textbox id="TextBox5" runat="server" cssclass="InputField" tooltip="Enter Invoice Date (DD/MM/YYYY)" ontextchanged="TextBox5_TextChanged" maxlength="10" autopostback="True" >="">
<asp:regularexpressionvalidator id="regexpName" runat="server"
="" errormessage="This expression does not validate."
controltovalidate="TextBox5"
validationexpression="^\\d{1,4}(\\.\\d{1,3})?$" enableviewstate="true">;
i have one problem.
that is in textbox, if i enter 22.1 it has to become 22.10
or 22 it has become to format 22.00
protected void TextBox5_TextChanged(object sender, EventArgs e)
{
double a;
a = Convert.ToDouble(TextBox5.Text);
TextBox5.Text = String.Format("{0:f3}", a);
}
it changes the format but it does not validate then.
i.e it is been trigered after the validation.
i.e even if i enter 111111 it just appends zeroes like 111111.000 .
so is there any way i could do the validation and change the format after validation in the textbox.
thanks in advance.
sriharsha
|
|
|
|
|
This works as you expected. I assumed that you have set Textbox1.AutoPostBack = True; Even though the error has been captured by the validation control it doesn't causes validation for textbox. So TextBox5_TextChanged has been fired.
Make the TextBox's CausesValidation = "True". Its working fine as you expected and I have checked it. Please let us know if you find any problem.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
hi,
its working . i made TextBox's CausesValidation = "True".
thanks a lot
i had one more problem , is there any way i could always keep zeroes in the decimal places while typing the number in the textbox.
thanks and regards,
sriharsha
|
|
|
|
|
if you use .net 2.0 or .net 3.5 you can use this .
try here [^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
hi,
i have tried using masked edit extender and maskedvalidating extender
but the problem here is it allows to enter in any location of the textbox .
i.e if input is 111111.10
no problem
but if input is 1_____.10
it gets converted to 1000000.10 automatically.
or if input is __12_.10
it gets converted 120.10
how can we solve this problem.or is there any other way we can have zeroes in decimal place always in the textbox while typing.
Thanks and regards,
sriharsha
|
|
|
|