ستون gridview و استایل خاص
با سلام خدمت دوستان عزیز
به طه مشکلی بر خوردم و اون اینکه من یه فیلد تاریخ تو gridview دارم که باید نشون بدم . وقتی فیلدم حالت عادطه و صفحه RTL هست تاریخ رو با فونت فارسی نشون میده اما برعکس یعنی :
02/02/1386
اما وقتی یه style تعریف میکنم و توی اون direction=LTR میکنم و اون ستون تاریخ gridview رو به این استایل منحصر میکنم بر عکس بودن تاریخ درست میشه اما فونت هم همراش انگلطسی میشه و اعداد رو انگلیسی نشون میده نه فارسی . راهی هست؟
نقل قول: ستون gridview و استایل خاص
با سلام.
می خوام وقتی موس رو سطرهای GridView میره سطر مورد نظر رنگ زمینه اش تغییر کنه.چه طور میشه این کارو کرد؟
ممنون.
نقل قول: ستون gridview و استایل خاص
با سلام
این سوال منم هست ممنون میشم یکی جواب بده
نقل قول: ستون gridview و استایل خاص
نقل قول:
نوشته شده توسط
hamed_bostan
با سلام خدمت دوستان عزیز
به طه مشکلی بر خوردم و اون اینکه من یه فیلد تاریخ تو gridview دارم که باید نشون بدم . وقتی فیلدم حالت عادطه و صفحه RTL هست تاریخ رو با فونت فارسی نشون میده اما برعکس یعنی :
02/02/1386
اما وقتی یه style تعریف میکنم و توی اون direction=LTR میکنم و اون ستون تاریخ gridview رو به این استایل منحصر میکنم بر عکس بودن تاریخ درست میشه اما فونت هم همراش انگلطسی میشه و اعداد رو انگلیسی نشون میده نه فارسی . راهی هست؟
منم این مشکل رو دارم که جهت تاریخم عوض میشه
میشه راهنمایی کنید که کجا و چطو باید استایل رو تعریف کنم ؟
نقل قول: ستون gridview و استایل خاص
نقل قول:
نوشته شده توسط
nadia2174
با سلام.
می خوام وقتی موس رو سطرهای GridView میره سطر مورد نظر رنگ زمینه اش تغییر کنه.چه طور میشه این کارو کرد؟
ممنون.
سلام
این کار اصولا از طریق JavaScript ممکنه. فکر کنم اونجا Search کنید، نتیجه بگیرید
تا جایی که می دونم یه مقدار دردسر داره. تو وب بگردید احتمالا یه چیزایی پیدا می کنید
1 ضمیمه
نقل قول: ستون gridview و استایل خاص
یه کلاس برا استایلش تعریف کن هر جور که می خوای مقدار دهی کن.
نقل قول: ستون gridview و استایل خاص
نقل قول:
نوشته شده توسط
ali.akhbary
یه کلاس برا استایلش تعریف کن هر جور که می خوای مقدار دهی کن.
سلام این کارو کردم .
کلاس hover هم براش نوشتم ولی کار نمیکنه!
اگه کد دقیقشو میدونید لطفا راهنمایی کنید.
مرسی.
نقل قول: ستون gridview و استایل خاص
سلام :
اول یک کلاس CSS برای زمانیکه موس روی سطر میره بساز(مثلا RowHover)
دوم: Grid خانم یک رویداد داره به اسم RowCreated میتونید کد زیر رو برای تغییر کلاس سطر بهش اضافه کنید:
e.Row.Attributes.Add("onmouseover", "this.className='RowHOver';")
در کل اگر گریدی به اسم grvEtageres داشته باشیم شکل کلی اینطوری میشه:
ProtectedSub grvEtageres_RowCreated(ByVal sender AsObject, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grvEtageres.RowCreated
e.Row.Attributes.Add("onmouseover", "this.className='RowHOver';")
EndSub
مشکلی بود مطرح کنید راهنمایی کنم
موفق باشید
alireza_s_84@yahoo.com
نقل قول: ستون gridview و استایل خاص
من در جدولم در پایگاه یک فیلد از نوع Date دارم که موقع نمایش آن در صفحه با استفاده از یک تکه برنامه آن را به شمسی تبدیل می کنم حال چگونه می توانم همین فیلد را در GridView به شمسی نشان دهم؟
(در حالت عادی فیلد مورد نظر را از پایگاه می خوانم وآن را به عنوان پارامتر به تکه برنامه تبدیل می فرستم در حالت گرید ویو چه چیزی را به عنوان پارامتر ارسال کنم؟)
تو رو خدا یکی جواب بده یعنی هیچ کس نمی دونه چه جوری می شه این کار رو انجام داد؟
نقل قول: ستون gridview و استایل خاص
برای رنگی شدن سطر گرید باید این مراحل را انجام بدی :
1- در تابع RowDataBound کد زیر را اضافه کنید :
protectedvoid Gd_Modiran_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//======onMouseOver , onMouseOut=================
e.Row.Attributes["onmouseover"] =
"javascript:setMouseOverColor(this);";
e.Row.Attributes["onmouseout"] =
"javascript:setMouseOutColor(this);";
//قرار دادن شماره کارمندی در یک لینک
}}
2- کد زیر را هم در جائات اسکریپت قرار بدی :
var oldgridSelectedColor;
function setMouseOverColor(element)
{
oldgridSelectedColor = element.style.backgroundColor;
element.style.backgroundColor='#d3d3d3';
// element.style.backgroundColor='#dcdcdc';
element.style.cursor='hand';
}
function setMouseOutColor(element)
{
element.style.backgroundColor=oldgridSelectedColor ;
}
نقل قول: ستون gridview و استایل خاص
نقل قول:
نوشته شده توسط
fa_karoon
من در جدولم در پایگاه یک فیلد از نوع Date دارم که موقع نمایش آن در صفحه با استفاده از یک تکه برنامه آن را به شمسی تبدیل می کنم حال چگونه می توانم همین فیلد را در GridView به شمسی نشان دهم؟
(در حالت عادی فیلد مورد نظر را از پایگاه می خوانم وآن را به عنوان پارامتر به تکه برنامه تبدیل می فرستم در حالت گرید ویو چه چیزی را به عنوان پارامتر ارسال کنم؟)
تو رو خدا یکی جواب بده یعنی هیچ کس نمی دونه چه جوری می شه این کار رو انجام داد؟
اگه از کلاس استفاده کنی میتونی یه خاصیت باسش تعریف کنی.تو متد get اونو تبدیل کنش
public string FaDate
{
get
{
return Persia.Calendar.ConvertToPersian(datetime.now).Sim ple
{
{
حالا باید مقدار این خاصیتو به ستون موردنظرت بدی
("Eval("FaDate
نقل قول: ستون gridview و استایل خاص
نقل قول:
نوشته شده توسط
hamed_bostan
با سلام خدمت دوستان عزیز
به طه مشکلی بر خوردم و اون اینکه من یه فیلد تاریخ تو gridview دارم که باید نشون بدم . وقتی فیلدم حالت عادطه و صفحه RTL هست تاریخ رو با فونت فارسی نشون میده اما برعکس یعنی :
02/02/1386
اما وقتی یه style تعریف میکنم و توی اون direction=LTR میکنم و اون ستون تاریخ gridview رو به این استایل منحصر میکنم بر عکس بودن تاریخ درست میشه اما فونت هم همراش انگلطسی میشه و اعداد رو انگلیسی نشون میده نه فارسی . راهی هست؟
تو کد html جایی که از تاریختو استفاده می کنی این کد رو اضافه کن :
‎